Unable to open iMessage app extension

I was able to use the latest version of the XCode project manipulator API to add an iMessage app extension to the XCode project built by Unity in a post build hook. The project can then be built and installed on device, the iMessage app being installed alongside the containing Unity app.

However, while the Unity app appears to work fine, the iMessage app extension fails to load, stuck on a screen with the app icon, failing to proceed, and appearing to be completely frozen. When XCode attempts to attach its debugger it complains that it “Could not attach to pid…”

Device logs are very cryptic, the only reported errors that seem to be relevant are
“: Hub connection error Error Domain=NSCocoaErrorDomain Code=4097 “connection to service named ” UserInfo={NSDebugDescription=connection to service named }”

I was wondering if this was somehow a problem with my use of the XCode project manipulator so I attempted to repeat the process manually with an entirely new and empty Unity project. After building the XCode project I manually added an iMessage build target, and attempted again to build to device. The result was the same as before. I did find out however that a Stickers extension appears to work completely fine.

Has anyone else had a similar experience? Is there a solution?

I somehow was able to solve this problem 20 minutes after posting the original question (before which I had spent hours fumbling with XCode build settings trying to get this to work) :smile:.

For whatever reason the architectures build flag defaults to only armv7 when the target is originally added to the project. Setting archs to armv7, arm64 appears to solve the above problem. I’m not sure what magic is going on for the iMessage build target to default to armv7, but it seems to be something about the Unity app build settings since this is normally not a problem with more vanilla XCode projects.

2 Likes

You’re so smart!!!Thank you very much.

Thank you very much for this !!

Thanks for this. This helped me too.