I am trying to add iCloud Documents Capabilities to my iOS application Bundled in Defold and I keep getting errors.
On the Apple Developer site I’ve created an iCloud Container Identifier and enabled iCloud Capabilities (Compatible with Xcode 5) in the App ID . I’ve also created and downloaded an Ad Hoc app Profile with the iCloud Capabilities App ID.
“iCloud Compatible with Xcode 5” excludes support for CloudKit which is not needed.
With Xcode I generated this iCloud entitlements file:
In the Defold project file I point to /builtins/manifests/ios/Info.plist for the Info.plist setting and I point to /iCloud.entitlements for the Custom entitlements setting.
I get this error in Defold when I bundle for iOS application: java.io.IOException: Invalid custom iOS entitlements key 'com..apple..developer..icloud-container-identifiers'.
When I add this setting: override_entitlements = 1
to the Defold project file the application builds without errors but I get the following error when I try to install the app with Xcode on a device: The executable was signed with invalid entitlements. The entitlements specified in your application’s Code Signing Entitlements file are invalid, not permitted, or do not match those specified in your provisioning profile. (0xE8008016).
When I add the entitlements manually to a custom Info.plist file the app builds, installs and launches on the device but it immediately crashes with these errors. <Error>: secTaskDiagnoseEntitlements MISSING keychain entitlements: no stored taskRef found <Notice>: AMFI: hook..execve() killing pid 13563: entitlements not XML
Development environment: OSX Version 10.11.6, Defold Version:1.2.164
Any ideas on how to proceed would be most appreciated.
I think there is a bug with overriding entitlements in Defold but I’m posting this in case I’m missing something.
From the docs : Entitlements
“If specified, can override wildcard entitlements defined in the supplied provisioning profile (.entitlements, .xcent, .plist).”
The entitlements in my downloaded Provision file created on the Apple dev site has 3 wildcard values in these keys: keychain-access-groups, com.apple.developer.ubiquity-kvstore-identifier and com.apple.developer.icloud-services.
NewTestIDadHoc3Devices.mobileprovision entitlements:
Then Bundle an iOS Application with the above Provisiong profile, NewTestIDadHoc3Devices.mobileprovision. The embedded.mobileprovision entitlements wildcard “*” values are unchanged with or without adding override_entitlements = 1 to the game.project settings.
When I add the <key>Entitlements</key> to the iCloud.entitlements file and Bundle for iOS in Defold I get this error: Unknown source java.io.IOException: Invalid custom iOS entitlements key 'Entitlements.keychain-access-groups'.
When When I add <key>Entitlements</key> to the iCloud.entitlements file combined with adding override_entitlements = 1 to game.project I get this error: Unknown source /var/folders/wr/37b7w66x6rs7tf0z52cf_gfm0000gn/T/entitlement3795777977671083398.xcent: unrecognized blob type (accepting blindly) /var/folders/wr/37b7w66x6rs7tf0z52cf_gfm0000gn/T/entitlement3795777977671083398.xcent: invalid length in entitlement blob
When this is set to 1, the file you specified in ios.entitlements will be used directly, without alteration.
When it is set to 0(or left out), we will try to merge it with our own entitlements.
However, this merging is a bit buggy still, so I’d advice you to use a full entitlements file, ans set the value to 1.
As to why is doesn’t work in your case, I don’t know. Do you get any output at all?
Without override_entitlements = 1 in game.project, without <key>Entitlements</key> in FulliCloud.entitlements:
No build errors. No change to entitlements in embedded.mobileprovision from entitlements in AdHoc Provision, wildcard values are still wildcard “*”.
Without override_entitlements = 1 in game.project, with <key>Entitlements</key> in FulliCloud.entitlements:
Build Error Unknown source java.io.IOException: Invalid custom iOS entitlements key 'Entitlements.com..apple..developer..ubiquity-container-identifiers'.
With override_entitlements = 1 in game.project, without <key>Entitlements</key> in FulliCloud.entitlements:
No build errors. No change to entitlements in embedded.mobileprovision from entitlements in AdHoc Provision, wildcard values are still wildcard “*”.
With override_entitlements = 1 in game.project, with <key>Entitlements</key> in FulliCloud.entitlements:
Build Error Unknown source unknown exception
This a barebones test project created from the Defold Mobile game template.
In all my tests I am unable to get the custom entitlements to merge or completely overwrite the AdHoc Provision entitlements.