Reputation: 385
I have an OS X app targeting 10.7 (Lion) platform. I use XCode 4.4 on a development machine where iCloud is enabled. The OS X version on this machine is 10.8 (Mountain Lion).
I have an APP ID that I enabled iCloud
using the Developer Certificate Utility: com.company.appname
. The utility shows a green tick next to iCloud label under description of the App ID.
From XCode
Target/Summary
tab I enabled Entitlements
and added iCloud Container com.company.appname
. Of course internally it is preceded by the team id in the Entitlements file: teamid.com.company.appname
.
I also have a valid (green ticked) provisioning profile on my Mac with the same id:teamid.com.company.appname
.
Derived Data
locations is set to Relative
from XCode/Preferences
.
The app builds OK. But when I run it I get "Could not launch "appname". Permission denied."
error.
If I remove the iCloud container id com.company.appname
from iCloud Containers
list box under Entitlements and build the app, it runs OK. But of course I cannot access iCloud container enabled for the app.
I have been working on this problem for the past 24 hours. I have read the guides; Developing for the App Store
, App Sandbox Design Guide
, and Entitlement Key Reference
inside out. Yet I am stuck. What went wrong?
I am desperate and I will be grateful if you can help me.
Upvotes: 0
Views: 2975
Reputation: 9579
I think the most likely problem is that the AppID, the Entitlement and your provisioning profile do not match each other. This can happen easily if you experiment a lot with those settings. It should work right out of the box if you create a fresh new project with valid settings, but it might get corrupted if you convert, change or edit existing projects.
Do not forget about the 10-digit prefix of your app bundle id. This is required, esp. for iCloud Key-Value-Storage!
ABCDE01234.com.domain.app
Then it should work. Hopefully.
Edit: thought it would be nice to add the link to the app id center: https://developer.apple.com/certificates/index.action#bundlelist
Upvotes: 1