I am trying to upload an app to the app store and I am getting this error on the page that has the certs. As far as I can tell I have changed the field so they have matched,
Multiple targets:
...and use iCloud.
Turning iCloud on and off was not an option for us. We already use it in production and rather not mess with it... I got the original question's message and this variation at some point as well:
Profile doesn't match the entitlements file's values for the application-identifier and keychain-access-groups entitlements.
Hinted from other responses here, We made sure that all targets would have a .entitlements
file. If the target had none we created an empty one like so:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict/>
</plist>
...and pointed it's target Code Signing Entitlement
in Build Settings
to the empty .entitlements
file.
Solved!
What worked for me was that I made the archive in XCode 11, and did the upload in it Xcode 12 beta.
I'm not sure why this fixed it, but I went into my Target's Capabilities tab, turned iCloud ON, tried to do an archive build, it failed, I turned iCloud OFF again, tried to do an Archive build and it succeeded, and after that it was able to automatically resolve certificates again.
The app you created has an incorrect application-identifier
value, for what the provisioning profile is expecting. The cert for appID com.example.foo for the team 2ABCDEFG will be expecting application-identifier: 2ABCDEFG.com.example.foo, your app declared that its appID was com.example.foo, but the application-identifier didn't match, either you are using the wrong team-prefix, or you have the bundleID misconfigured.
In my case, I am using build schemes to allow me to build a prod app and a qa app. com.example.foo for prod, and com.example.foo.qa for QA. I had set my bundleIdentifier in the Info.plist to $(PRODUCT_BUNDLE_IDENTIFIER)$(BUNDLE_SUFFIX), which works great in the simulator and on device for having different apps, however, when the app generates its application-identifer during the archive phase, it must not be reading the bundleIdentifier generated by the Info.plist.
To remedy the situation, I edited FooProject.xcodeproj/project.pbxproj (with a text editor) to change my QA buildSettings PRODUCT_BUNDLE_IDENTIFIER to com.example.foo.qa
You can see Apple's Technical Q&A to see their in depth dive into solving this. Once you run the codesign entitlements on your exported app, and see what application-identifier your app was just built with, it should be pretty quick to realize what your are doing wrong. https://developer.apple.com/library/content/qa/qa1879/_index.html I didn't find that page in my Google searching, because they don't actually use the phrase from the error message or call the application-identifier by its full name, but instead say App ID.
Also, the solution to this problem isn't to generate a new provisioning profile that has the application-identifier entitlement, it does have that entitlement, however, the value in the provisioning profile, and your app have to match.
In Xcode 11, this could happen when a .entitlement file is not present for your project. The solution would be to add any random capability by clicking on '+ Capability' under 'Signing & Capabilities' (which leads to the creation of an .entitlement file) and then removing the capability. This will let you automatically provision a certificate too.
Please check your application features which required for your application like In app purchase , push notification , Inter App audio , Siri kit etc.
This is the only cause for this type of error.
Make sure that in your App id the above flags should be on.
Most of time it happens when you not configured push notification , In App purchase in you development App ID.