ERROR ITMS-90164/90046: Invalid Code Signing Entitlements
Asked Answered
C

27

88

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.

Commute answered 23/1, 2015 at 9:33 Comment(0)
C
21

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.

Commute answered 27/1, 2015 at 6:43 Comment(1)
xamarin is such a productivity boost!Hammerfest
D
133

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

Dayton answered 13/3, 2015 at 13:44 Comment(5)
can you explain this a bit more?Awesome
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.Dayton
This worked, I just cleaned it and compiled again and didn't change anything, why it failed the first time? MysteryHighpressure
Same problem here and same fix ! You saved me a strong headache ! Lot of thanks.Squabble
All I had to do was do the Clean...This was a new error after about 50 builds uploaded to TestFlightOctahedral
G
63

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

Ginseng answered 3/3, 2016 at 15:58 Comment(3)
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.Poliomyelitis
Had the same error as Josep and clean -> archive -> upload again solve it. Thanks for posting this solution!Calamine
Where do you do Product->Clean? In XCode or Visual Studio? I'm developing using Xamarin, BTW.Neuter
C
21

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.

Commute answered 27/1, 2015 at 6:43 Comment(1)
xamarin is such a productivity boost!Hammerfest
C
20

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.

Compotation answered 14/6, 2016 at 23:0 Comment(0)
P
11

Change this in Entitlements.plist:

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

To this:

<key>aps-environment</key>
<string>production</string>
Peltast answered 9/5, 2018 at 19:2 Comment(1)
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 AppleRick
P
8

Same problem and solved with a simple Product -> Clean.

Ploughboy answered 27/6, 2016 at 12:3 Comment(0)
C
5

This can also be caused by you having to agree to a new contract in iTunes connect. Log in to iTunes connect and you should see a banner at the top prompting you to agree to the latest contract change.

Canterbury answered 22/9, 2016 at 9:41 Comment(1)
Your'e a life saver :) Gotta love apple's unrelated error messagesHandspike
E
5

The entitlement file had empty arrays, removing those solved the issue.

Eucken answered 14/1, 2021 at 13:1 Comment(0)
E
4

For me, the problem was a Entitlements.plist that was auto-added and was empty. Removed it from the Custom entitlements field and solved the problem.

View of the iOS Bundle Signing on Visual Studio 2015

Entangle answered 3/4, 2017 at 11:29 Comment(0)
D
3

If you do not select the corresponding release certificate before you pack, ERROR ITMS-90164 will be reported

Build Setting -> the Code Signing Identity -> Release ->Any IOS SDK

Drop answered 17/2, 2016 at 5:48 Comment(0)
R
2

Make sure you have selected the App target and not the WatchKit App when archiving.

Rusticate answered 7/4, 2016 at 12:0 Comment(0)
G
2

None of the other answers solved this error for me, but this did:

  1. Create new XCode application and go examine it's code signing settings.

  2. Try to get your app to be set similarly to the default XCode 7 or Xcode 8 signing and provisioning settings, XCode 7 is shown here, it's changed again in XCode 8.

provisioning and signing

  1. If the above is not enough, you may need to do it again, but this time, before you do, delete any old expired provisioning profiles from your apple Keyring or delete and re-sign into your apple developer (itunes) account in the XCode preferences. Be sure to EXIT XCODE and RESTART after ANY changes. Then add your account again, and let XCode fetch your new signing and team information.
Gal answered 17/2, 2017 at 2:55 Comment(0)
C
1

I had tried to upload a build from a git branch that wasn't the master. To resolve the issue I merged the branch into the master and built again. I was then able to upload the build successfully.

Camphorate answered 24/1, 2016 at 3:49 Comment(0)
A
1

A project including 2 targets(with 2 Developer id ,2 entitlements) may lead to this. (Do not ask me how it is happened...)

When archiving, remove another entitlement file temporarily.

Amphibolous answered 19/9, 2016 at 8:49 Comment(0)
D
1

Doing a proper Xcode 'Quit' and then restart was the final action that got it working for me.

I had changed the bundle identifier (for a demo version) and got the same error (as detailed in the question) when verifying my archived build. I am using Xcode. Just closing Xcode and reopening my project wasn't enough, but a full 'Quit' was. Something was probably cached somewhere I'm guessing.

Drowsy answered 16/11, 2016 at 20:49 Comment(1)
This did it for me. XCode can be so finicky sometimes.Garnettgarnette
D
1

I tried everything listed here, turned out the problem was my .entitlement file, that had lines I never put in in the first place, they just got added somehow.
Removed those lines and tried again, worked.

Deneendenegation answered 12/12, 2016 at 10:11 Comment(0)
C
1

I have just renamed in entitlements.plist the value of Access domains from applinks:htts://domain.app.link to applinks:domain.app.link it works like a charm. Cheers!

Congeries answered 24/5, 2017 at 13:42 Comment(0)
C
0
  1. Go to Build Phase in Xcode
  2. Remove all the frameworks
  3. Add them back
  4. Now build->Archieve->Upload to App Store

Hurray, You are done with it. Problem solved

Cyril answered 16/2, 2016 at 13:40 Comment(0)
P
0

For me, I was able to solve it by turning off / on again the automatic code signing feature:

enter image description here

Premonitory answered 31/10, 2016 at 1:21 Comment(0)
G
0

For me I had the wrong file in my Custom Entitlements setting under iOS Bundle Signing. Removed it and it worked!

Gamelan answered 12/1, 2017 at 17:41 Comment(1)
Screenshot would be nice.Gal
P
0

After many hours of investigation, i found an easy solution.

Instead of using the application loader to upload the application, I used the Organizer from XCode and it worked without any warnings when doing the upload!

Prichard answered 23/2, 2017 at 15:55 Comment(0)
D
0

My problem is I was using a wrong bundle to create IPA file

Diplomatist answered 28/3, 2018 at 1:1 Comment(0)
O
0

I had exactly the same problem and it was quite a stupid mistake. I don't want anyone to spend time on this, so for this one:

Mistake

So what happened here, was that i entered '10' in the deployment target. That should have been 10.0 instead. That is what produced the infamous ERROR ITMS-90164/90046: Invalid Code Signing Entitlements for me!

Opinionative answered 30/5, 2018 at 8:42 Comment(0)
M
0

You should check your Entitlements. It is like plist file. Edit it to development and the remove the extra fields.

enter image description here

Millikan answered 17/4, 2019 at 2:42 Comment(0)
B
0

My two cents here.

Just now I stuck in this problem because when I copy my TeamID / Application ID from the apple developer portal which brings a lot of unrelated value to the entitlement.plist. I didn't notice this because I was using Xcode to edit the entitlement.plist and the input box will not display everything after the first new line character.

I suggest using plain text editor for entitlement.plist for this case.

Thanks, Samuel

Bename answered 25/7, 2019 at 6:53 Comment(0)
F
0

After trying all tricks read last days at Stackoverflow i delete file "xxxxxx.entitlements" and regenerate it again. I click at Capabilities, select ON at Associated Domains and adding "Domains". Then at Capabilities > Push Notifications click on Fix "Add the Push Notifications entitlement to your entitlement file".

Making that let me do ARCHIVE Successful

Franni answered 5/9, 2019 at 9:55 Comment(0)
T
0

I had a link like this webcredentials:https://************.link, which was causing my upload to fail. I removed it and the problem was solved.

Tonatonal answered 2/2, 2020 at 17:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.