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