Embedded Frameworks within a Message Extension App causing TestFlight submission Errors

I'm running into a problem that I'm not quite sure how to solve.


I have a stand alone message app that has a few embedded frameworks that I have written. In a normal app, those frameworks can live within the container app, and the extensions can reference them. With a message app, the dummy container app has no way to manage frameworks/linked libraries, so the message extension needs to manage them. This means the .appex now contains a framework folder within it.


When attempting to upload the binary, TestFlight returns the following error:


ERROR ITMS-90205: "Invalid Bundle. The bundle at 'XXXXXX.app/PlugIns/XXXXXXX.appex' contains disallowed nested bundles."


I'm not exactly sure how to manage the frameworks in this particular heirarchy to please the TestFlight Gods and get the app processed.


Has anyone successfully submitted a standalone message app with embedded frameworks? Should I file a rdar?

Accepted Reply

We've now got a Technical Q&A document with a workaround for this issue of embedding a framework. https://developer.apple.com/go/?id=framework-imessage

Replies

Specific errors:

ERROR ITMS-90205: "Invalid Bundle. The bundle at 'XXXXX.app/PlugIns/XXXXXMessages.appex' contains disallowed nested bundles."

ERROR ITMS-90206: "Invalid Bundle. The bundle at 'XXXXX.app/PlugIns/XXXXXMessages.appex' contains disallowed file 'Frameworks'."

I had this issue back in the first beta as well, not sure if we're allowed to embed frameworks for our iMessage app as this is not properly documented anywhere. Can anyone from Apple shed some light onto this? Are we allowed to embed frameworks for our iMessage app?


Kevin, maybe in the meantime you should go ahead and file a radar right away so we can get this resolved asap!

I filed rdar://27719595

Thanks, this is over with engineering, who asked if you could export your app to the store archive format and attach to the bug report?

Hey PDM,


I went down the rabbit hole last night of removing all of my shared code from frameworks and adding it directly to my message app just so I get testflight working, so I don't have a copy at the moment to share with the bug report.


Should be easy to reproduce though. Create a standalone message app, create a framework target with some dummy code that just prints to console link that with your message app, and try to submit it.


Kevin

Actually, found an older archive in Xcode that shows the heirarchy. Added to the rdar

Hello KevinSS:


We got a quick question that might be a stupid question but when you set the Bundle Identifier in the main "core" project, does your iTunes Connect app id match that or the Bundle Identifier set in the "Message Extension" info.plist?


We set the "Bundle Identifier" in the main project as "com.Site.AppName" and the "Bundle Identifier" in the "messageExtension" folder as "com.Site.AppName.messageextension". Is this what you did? We are stuck at the configuration part and there's no easy guide to follow.


Thanks, Henry

KevinSS and pdm,


We've got the same issue. The MessageExtension doesn't allow to embed frameworks, so as a workaround we had to create a real "main" app that is used to embed the frameworks that the MessageExtension uses. Not ideal since we'd prefer to remain an iMessage app only. I sure hope this gets fixed.


A misleading debuging step is that the MessageExtension with Linked frameworks works fine on the simulator. No main iOS host app required (aside from the app container). When we debug on the device, the device says


"dyld: Library not loaded: @rpath/Alamofire.framework/Alamofire

Referenced from: /private/var/containers/Bundle/Application/XXXXXX/PlugIns/MessagesExtension.appex/MessagesExtension

Reason: image not found"


The only way we've been able to get around this is by adding all the framework source to the MessageExtension (not great), or embedding the frameworks in an iOS app that also embeds the MessageExtension which defeats the purpose of a seperate iMessage app.


Seems like the hidden host app that delivers the MessageExtension should be able to embed frameworks inside of that, or allow MessageExtensions to embed the frameworks.


Any ideas?


Wes

Yep thats the behavior I see too Wes. I can work around the error you mentioned by adding a custom Copy Script to the build phase for the message extension, but then TestFlight fails because extensions can't have the embedded framework folder.


I think Apple is going to have to remove that restriction for Message only apps, and is what my rdar calls out. I haven't heard anything back on that front yet.

PDM,


Any update on this one?

Quick question, Wes—how did you get the extension to "see" the frameworks you linked inside the main host app? I have tried that and can't get them to work in import statements.


Also, were you able to submit to app store/Testflight using this technique?

Hi mlchild,


We haven't submitted to TestFlight yet. Still in developement and am hoping for a solution to this problem so I don't have to also develop a main iOS app as well.


To get the message extension to run on the device with linked frameworks is the frameworks must be Embedded in the main host app. Look under the "General" setting for the main host app target and add your frameworks to the Embedded Binaries list as well as the Linked Frameworks and Libraries list as well.


Wes

@PDM


My rdar://27719595 was closed as not a bug and I was sent basic information of how to link frameworks to an app, which don't work for embedded message apps. I can't reopen the rdar, and I believe it was closed in error.

I had the same problem and ended up creating a standalone app with the same functionality of my messages extension just so I could bundle the frameworks to the parent app. Of course this doesn't make sense for every case, but for my app I was already planning on having a standalone app as well so it wasn't that much work.

Any updates?


I've filed issue #28054854