Xcode 15.3 |AppStore build publish failing for mergeable binaries changes

The mergeable binaries changes which were working till Xcode 15.2 now started breaking in Xcode 15.3 when uploading to AppStore fails with below error:

  • [ContentDelivery.Uploader] Error Domain=ContentDelivery Code=90680 "Asset validation failed" UserInfo={NSLocalizedFailureReason=Invalid directory. The bundle Payload/MyApp.app/ReexportedBinaries/Pods_MyApp.framework is not contained in a correctly named directory. It should be under Frameworks. NSUnderlyingError=0x600001ec9200 {Error Domain=IrisAPI Code=-19241 "Asset validation failed"
  • Invalid Bundle structure. The "MyApp.app/ReexportedBinaries/Pods_MyApp.framework/Pods_MyApp" binary file is not permitted. Your app cannot contains standalone executable or libraries, other than a valid CFBUndleExecutable of supported bunldes

Below are changes in Podfile [Cocoapods based iOS project] specific to Mergeable binaries that were working till Xocde 15.2 and able to upload build to AppStore:

post_install do |installer|
  setup_project(installer)
# getMergeableLibraryNames() returns an array containing names of Pods as listed under Pods target which support Mergeable Binaries
  enable_mergeable_lib(getMergeableLibraryNames(), installer)
end

def setup_project(installer)
  installer.pods_project.targets.each do |target|
    configure_build_settings(target)
  end
end

def configure_build_settings(target)
  target.build_configurations.each do |config|
    config.build_settings['MERGEABLE_LIBRARY'] = 'YES'
  end
end

def enable_mergeable_lib(mergeable, installer)
  installer.aggregate_targets.each do |aggregate_target|
    aggregate_target.user_project.targets.each do |target|
      if target.name == "MyApp"
        aggregate_target.xcconfigs.each do |config_name, config_file|
          isRelease = config_name == "Release"
          updated_config = [getOtherLinkerFlags(mergeable, isRelease)]
          config_file.other_linker_flags[:simple] = updated_config
          xcconfig_path = aggregate_target.xcconfig_path(config_name)
          config_file.save_as(xcconfig_path)
        end
      end
    end
  end
end

def getOtherLinkerFlags(mergeable, isRelease)
  config = ""
  mergeable.each do |lib|
    if isRelease
      config = config + "-Wl,-merge_framework,#{lib} "
    else
      config = config + "-Wl,-reexport_framework,#{lib} "
    end
  end
  config = config + "-ObjC $(inherited)"
  return config
end

The App target has Create Merged Binary set to Manual As per Xcode 15.3 release notes, there seems some bug fix made by Apple related to Mergeable library but it is not clear what change we have to made in our existing code so as to fix above mentioned issues.