Search code examples
xamarin.iosprovisioning-profile

Xamarin.iOS: The executable was signed with invalid entitlements


I've recently added notifications (FCM) to an iOS app developed with Xamarin.iOS. When I try to install on a device in release - both on iPad and iPhone - the installation fails. All the similar questions I've found are related to native development. I tried to regenerate provisioning profiles removing and adding again push notification permission but it doesn't work. I'm quite sure it's a problem with entitlements.plist but I cannot see the error.

Reading device log I can see:

J:2688602321590689122,I:5638904815675342255#[]: Failed to install J:2688602321590689122,I:5638904815675342255#[]: Install failed after error:

0x16df47000 +[MICodeSigningVerifier _validateSignatureAndCopyInfoForURL:withOptions:error:]: 147: Failed to verify code signature of /private/var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.uANw57/extracted/Payload/Wine.iOS.app : 0xe8008016 (The executable was signed with invalid entitlements.)

installd(MobileSystemServices)[42] : 0x16df47000 -[MIInstaller performInstallationWithError:]: Verification stage failed


Solution

  • It was easy and the problem was really in Entitlements.plist.

    Trying to install the app directly from Xcode it returned this error:

    enter image description here

    I didn't notice that inside Entitlements.plist there was:

    <dict>
        <key>aps-environment</key>
        <string>development</string>
    </dict>
    

    It was enough to change 'development' with 'production'.