ERROR ITMS-90164/90046: Invalid Code Signing Entitlements

58,166

Solution 1

Finally after 2 weeks of hair pulling..

For some reasons, if there is no key 'application-identifier' in the Entitlements.plist that is set to TEAMID.com.Company.CompanyAppDemo, Xamarin will use the original application-identifier, i.e. TEAMID.com.Company.CompanyApp

So the solution was to add application-identifier specifying the correct application bundle ID inside Entitlements.plist. Then include the plist in the Build Options > iOS Bundle Signing.

Solution 2

If someone gets here by searching for ERROR ITMS-90046 like me, my solution was to Clean it and delete all precompiled frameworks (the custom ones) and then build again.

Note: The error description said something about key "aps-environment" as "development".

Edit: The actual error message

Solution 3

I had the same problem and solved with a simple Product -> Clean.

Solution 4

If someone gets here by searching for both error ITMS-90164 and error ITMS-90046 with get-task-allow and asp-environment keys:

1

Like David P said, a Product -> Clean before a new Archive did solve my problem.

I just want to add that in my case I observed that the faulty xarchive was missing the following file:

2

Before sending that .xarchive to your client for production signature, you might want to look for the archived-expanded-entitlements.xcent file and be sure it's there.

Solution 5

Change this in Entitlements.plist:

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

To this:

<key>aps-environment</key>
<string>production</string>
Share:
58,166
yonasstephen
Author by

yonasstephen

Main interests: iOS (Swift) Golang ReactJS

Updated on January 15, 2021

Comments

  • yonasstephen
    yonasstephen over 3 years

    Note: I'm developing using Xamarin. Similar question posted in Xamarin Forum here

    I'm creating an app called, say CompanyApp. Then I created an App ID for it com.Company.CompanyApp, along with Distribution Provisioning Profile that uses the corresponding App ID. I uploaded the binary and it worked perfectly fine.

    Then I went on create a demo version of the app (basically the same app with small modification, so it's the same solution & project, just different bundle signing setting), CompanyAppDemo with a new App ID com.Company.CompanyAppDemo, along with a new Distribution Provisioning Profile that uses the new App ID. I updated the iOS Bundle Signing options to use the new Provisioning Profile and generated the IPA. But when I uploaded this to Application Loader, I got the following error:

    [2015-01-23 16:08:21 SGT] ERROR: ERROR ITMS-90164: "Invalid Code Signing Entitlements. The entitlements in your app bundle signature do not match the ones that are contained in the provisioning profile. According to the provisioning profile, the bundle contains a key value that is not allowed: 'TEAMID.com.Company.CompanyApp' for the key 'application-identifier' in 'Payload/CompanyApp.app/CompanyApp'"

    [2015-01-23 16:08:21 SGT] ERROR: ERROR ITMS-90046: "Invalid Code Signing Entitlements. Your application bundle's signature contains code signing entitlements that are not supported on iOS. Specifically, value 'TEAMID.com.Company.CompanyApp' for key 'application-identifier' in 'Payload/CompanyApp.app/CompanyApp' is not supported. This value should be a string starting with your TEAMID, followed by a dot '.', followed by the bundle identifier."

    I have been debugging for days to figure out to no avail.

    I am wondering why when I signed with the new profile, the error that Application Loader threw refer to the ID of the original TEAMID.com.Company.CompanyApp instead of TEAMID.com.Company.CompanyAppDemo? Is this a bug in Xamarin that pick up a wrong provisioning profile or am I missing something? You don't need different certificate for different app right?

    Note that I have always refreshed the Provisioning Profile list in XCode > Preference before changing the iOS Build Signing option in Xamarin.

  • John
    John about 9 years
    can you explain this a bit more?
  • quarac
    quarac about 9 years
    Yes, in my app I'm using custom frameworks, they are added in the "build phases" "target dependencies" section, so when I compile the app, they are compiled and also signed. Also I have a script in each framework "build phases" that moves the compiled framework to another folder. There seems to be a bug with the signing process and I think the key part was the deletion of the frameworks, forcing the compiler to compile and sign them again. That error never happen again.
  • rr1g0
    rr1g0 almost 9 years
    This worked, I just cleaned it and compiled again and didn't change anything, why it failed the first time? Mystery
  • stefat
    stefat over 8 years
    Same problem here and same fix ! You saved me a strong headache ! Lot of thanks.
  • Phamer
    Phamer over 8 years
    All I had to do was do the Clean...This was a new error after about 50 builds uploaded to TestFlight
  • Josep Escobar
    Josep Escobar almost 8 years
    thanks worked for me to solve ERROR ITMS-90164: "Invalid Code Signing Entitlements. The entitlements in your app bundle signature do not match the ones that are contained in the provisioning profile. According to the provisioning profile, the bundle contains a key value that is not allowed: 'true' for the key 'get-task-allow' in 'Payload/Palau Moja.app/Palau Moja'" ERROR ITMS-90164: "Invalid Code Signing Entitlements. The entitlements in your app bundle signature do not match the ones that are contained in the provisioning profile.
  • Anton Tropashko
    Anton Tropashko almost 8 years
    xamarin is such a productivity boost!
  • Yoav Schwartz
    Yoav Schwartz over 7 years
    Your'e a life saver :) Gotta love apple's unrelated error messages
  • little
    little over 7 years
    Had the same error as Josep and clean -> archive -> upload again solve it. Thanks for posting this solution!
  • Warren  P
    Warren P about 7 years
    Screenshot would be nice.
  • Aaron Krauss
    Aaron Krauss about 7 years
    This did it for me. XCode can be so finicky sometimes.
  • James Lavery
    James Lavery over 5 years
    Where do you do Product->Clean? In XCode or Visual Studio? I'm developing using Xamarin, BTW.
  • Emil
    Emil about 2 years
    why? what is the point? this is automatically managed by Apple based on your Profile. If you use Distribution profile, it will be set as production automatically by Apple