I\'m having a problem with some KeyChain code causing archives created via xcodebuild to crash when distributed as ad-hoc apps and run on a device. The problem
This error indicates a problem with your app's entitlements. In my experience, the cause is often that the App Identifier Prefix in the app's entitlements doesn't match the App Identifier Prefix in the provisioning profile.
To verify, use the codesign tool to view your app's entitlements:
codesign -d --entitlements - MyApp.app/
Then, compare the App Identifier Prefix to that in the provisioning profile:
cat MyApp.app/embedded.mobileprovision