Search code examples
iosxamarin.ioskeychainprovisioning-profileentitlements

The executable was signed with invalid entitlements error only on device


I have created an iPhone app in Xamarin. I have enabled KeyChain sharing in the Entitlements.plist so that I can share some data across similar apps. The app works and debugs fine on a simulator. However when I sign the app with a development or distribution provisioning profile, the app does not deploy on the device. If I disable the KeyChain sharing the app works fine.

I get an error like so :-

Info (216) / streaming_zip_conduit: _dispatch_source_read_socket_block_invoke:312: Failed to install application at file:///var/mobile/Media/PublicStaging/appname.iOS.app/ : Error Domain=MIInstallerErrorDomain Code=13 "Failed to verify code signature of /private/var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.VEgA0a/extracted/Poll365.iOS.app : 0xe8008016 (The executable was signed with invalid entitlements.)" UserInfo={LibMISErrorNumber=-402620394, LegacyErrorString=ApplicationVerificationFailed, SourceFileLine=147, FunctionName=+[MICodeSigningVerifier validateSignatureAndCopyInfoForURL:withOptions:error:], NSLocalizedDescription=Failed to verify code signature of /private/var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.VEgA0a/extracted/appname.iOS.app : 0xe8008016 (The executable was signed with invalid entitlements.)} 

I have previously implemented the same on other apps. I assume it might be an issue due to iOS 10, which I am not sure of. How can I fix this?

Any help is appreciated.


Solution

  • Refer to sharing-keychain-in-ios

    Scroll down to read What is my App ID Prefix?

    I found when you enable keychain in Entitlements, it auto generates App ID Prefix in Xcode , However in Xamarin.ios it lacks ofApp ID Prefix, you have to complete the Keychain access group name .

    It looks like AB123CDE45.myKeychainGroup ,App ID Prefix + App ID.