iMessage app, "disallowed nested bundles" error trying to archive/upload with binary framework

Viewed 365

I have an iMessage app (not an app with an iMessage extension) in which I have successfully added a binary framework (the project runs just fine on device and simulator)

However, I cannot successfully upload the project to App Store Connect - upload from the archive build returns the following errors:

Upload error

The relevant text of the error is:

The bundle ... contains disallowed nested bundles. Refer to https://developer.apple.com/go/id=framework-imessage

That link (if you follow the instructions for using an newer Xcode version) leads you back to the link below I used to add the framework to begin with... to run you will need Xcode 11 as I am using an XCFramework.

I added the framework to the iMessage app as instructed by Apple here:

https://developer.apple.com/library/archive/technotes/tn2435/_index.html

(see Embedding a Framework in an iMessage App section)

What do I need to change to the settings for the project or extension in order for the archive/upload process to succeed, while actually including the framework I need? I have searched on StackOverflow, and found a variety of posts related to cocoapods, or around various build settings of "Always Embed Swift Standard Libraries" that do not help.

I have reduced the problem down to a simple sample app you can see here, which builds and runs just fine but cannot be archived and uploaded:

https://www.dropbox.com/sh/jpa4oe7zlnb21wl/AACXkLbxIbayZUtJr3VDwO07a?dl=0

That directory contains a zip file of the project, and an image showing the error encountered.

2 Answers

You have .xcframework in your project. May be you haven't enable Build Libraries for Distribution in Build setting when you have build .xcframework. You can refer this link for this.

Edit:

Error message is Invalid Bundle. So check bundle name of message extension and frameworks which are in the .xcframework.

I've made a few changes regarding the stub app, it seems to work and validate ok.

  1. Remove the Embed Framework from the extension target.
  2. Add the Embed Framework in the app target, set the Destination to 'Frameworks'

Related