We have a very strange issue where our share extension is failung BUT only when run once a build has been exported for distribution.
It builds fine & runs fine when run in a simulator, and if you just choose to run on a connected device in xcode
Everything appears to be signed correctly with app groups etc appropriately set. We click on a photo on the device > choose share > choose our app icon and nothing happens.
If we export the archive & then debug it attached to xcode, then we can see it falls over on the following line:
filemanager.default.containerurl(forsecurityapplicationgroupidentifier: "group.com.blah.blahshareext") //returns nil
Anyone seen anything like this before?
After a lot of head scracthing this turned out to be an issue with the code signing entitlements (which is sort of what i though in the first place). Even though automatic code signing was turned on, for some reason the appropraite entitlement for app groups was not set
under the target build settings > code signing > code signing entitlements there were different files specifed for debug and release configurations
the debug (entitlements-debug.plist) one had the required entitlements set, but the release one (entitlements-release.plist) was empty!