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.
If someone gets here by searching for ERROR ITMS-90046 like me, my solution was to make a Clean, delete all precompiled frameworks (the custom ones) and then build again.
Note: The error description said something about key “aps-environment” as “development”.
I had the same problem and solved with a simple Product -> Clean.
If someone gets here by searching for both error ITMS-90164 and error ITMS-90046 with get-task-allow and asp-environment keys:
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:
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.
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.
Same problem and solved with a simple Product -> Clean.
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.
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
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.
Make sure you have selected the App target and not the WatchKit App when archiving.
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.
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.
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.
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.
None of the other answers solved this error for me, but this did:
Create new XCode application and go examine it’s code signing settings.
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.
- 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.
- Go to
Build Phasein Xcode
- Remove all the frameworks
- Add them back
- Now build->Archieve->Upload to App Store
Hurray, You are done with it. Problem solved
For me I had the wrong file in my Custom Entitlements setting under iOS Bundle Signing. Removed it and it worked!
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!
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!