ITMS-90562: Invalid binary when uploading build to TestFlight

After migrating our project dependency manager from CocoaPods to SPM, we ended up not being able to upload builds on TestFlight anymore as they are all marked as Invalid Binary. This is happening with Xcode 13.3.1.

The structure of the project's workspace consists of 3 targets: the app target and 2 frameworks. The app target itself contains Watch, Notifiication, Widget and Intent handler extensions. Each of them embeds (Embed & Sign) either one or both of the other 2 frameworks in the project. The swift packages are all added to the app project and included in the target's embedded content and libraries where needed.

Now..the report email from Apple states:

ITMS-90562: Invalid Bundle - One or more dynamic libraries that are referenced by your app are not present in the dylib search path.

After researching this for a while I've been trying to tackle the problem in a few ways:

  1. Checked (with otool) that all libraries annotated with @rpath at the runtime libraries search path are also embedded in Xcode in their corresponding target. :white_check_mark:
  2. Tried to change the ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES flag from being YES in the app target, NO in the Watch app and Watch extension and the other way around :white_check_mark:
  3. Tried uploading with bitcode disabled :white_check_mark:

nothing worked really.

I feel like I'm kind of at a dead end, not sure what kind of options do I have left or what could be missing. The apps buid/run no problem on the simulators and devices.

I'd very much appreciate any kind of suggestion or idea of which might be other solutions worth trying.

Thanks a lot.

1 Like

Hi @_vladi,

We're facing the same issue after migrating from CocoaPods to SPM. We also tried several things but had no luck yet.

We achieved uploading a build without the Invalid Binary message by adding one pod to the Podfile and running pod install as a workaround.

I noticed that if you have at least one pod installed, the [CP] Embed Pods Frameworks build phase is added and the "${PODS_ROOT}/Target Support Files/Pods-{Project}/Pods-{Project}-frameworks.sh" script is executed, making the Apple validation of the .ipa to pass after the upload.

I will check what this script does under the hood to see if I'm able to understand what is making the .ipa invalid and post it here!

Have you managed to fix this issue? If the answer is yes, would you mind sharing how you solved this, please? Any kind of suggestion or idea is welcome!

Thank you in advance! :raised_hands:

We fixed this issue some months ago but I forgot to mention here what worked in the end for us:

  • Change Xcode version to 13.4.1 or greater (this was key)
  • Fix project dependencies linking
  • Change internal/in-house Swift packages from dynamic to static

I hope it helps other people facing this issue!