[ios] App installation failed due to application-identifier entitlement

I am unable to install a watchOS 2 WatchKit app due to an application-identifier entitlement. This happened after turning on App Groups in the Capabilities tab.

Full error:

App installation failed

This application's application-identifier entitlement does not match that of the installed application. These values must match for an upgrade to be allowed.

Screenshot 1

This is running the app in debug mode on a physical device. Running just the iOS app works fine.

I have turned App Groups off again and removed the entitlements files that were added, but same error.

This question is related to ios watchkit watchos-2

The answer is


None of the answers above worked for me. My problem: I had installed an App Version from Testflight, so, I just deleted both, the old app and the Testflight version, and is working again.


With MacOS Catalina, your iPhone will be displayed in the 'Locations' sidebar of Finder windows (as long as you've got the Finder preferences set up to show external devices) - you can then access the files via the 'Files' option which is available from the bar near the top of the window, just below the title (in my case I had to click the '>' at the right).


I had the same issue. The bundle.identifier and the name of the project has to be the same. At least that was my issue.


In most of the responses to this issue, there's one critical aspect being overlooked that was brought up by the original asker. The app needs to be installed without deleting the existing install. In my case, the app uses an SQLite database that stores quite a bit of data for the user. Obviously, if you delete the app, then you delete the data. A solution that allowed me to test it in the same way a user will update it was a must.

In my case, the issue was Xcode using a provisioning profile automatically generated by Xcode. This probably happened because I got a new computer and didn't transfer the distribution provisioning profile over. Not to mention, I had not updated the app in almost 2 years. So my original provisioning profile (which contains the Entitlements application-identifier) was long gone. Solution: in Xcode preferences-> Accounts-> Select the appropriate Apple ID-> View Details-> Under Provisioning Profiles, right-click on the Xcode-generated profile for that app (it's prefixed with XC iOS), and select Move to Trash.

Xcode provisioning profiles under Accounts

On the developer website, create a new distribution profile with your App's ID. Download the new profile, double click and Xcode should automatically install it. Conversely, you could return to the profiles listed in Xcode and tap the Download button next to your newly created profile. Build the app and try running again. By the way, my Xcode is set to automatically manage code signing, which other than this issue works great.


Here's what finally fixed it for me (Xcode 11). Ran into this issue running Apple's sample project "CoreDataCloudKitDemo" (WWDC 2019 session 202).

I unchecked the "Mac" deployment option in the project's "General" settings, and kept "Automatically manage signing". Now that it was an iPhone/iPad app, the error went away and I could build.

I then re-checked the "Mac" option, and Xcode asked it it should do it's magic to manage entitlements, etc.; I agreed, and Xcode resolved all the issues, and I was able to build the Mac version.


This happened when I tried installing over top of an adhoc build.


I had the same error and I solved it by changing Bundle Identifier to something new. After that it build project with no problem.

My steps:

  • Open Xcode
  • Go to General tab
  • Find Identity
  • Change Bundle Identifier to something new.

Bundle identifier change


In my case it was because of the certificate.

because my own certificate to sign the app wasn't part of the developper team (new employee), upgrading the app from the App Store to a new version wasn't allow.

So in case it happen to you and you can't manage to obtain a "good" certificate, just clone the git appStore version, open two Xcode projects, compile the old version, update the settings as you wish, the compile the new one and you're done.

a little bit dirty and tricky but I hope it could help someone.


For me, this occurred after updating to XCode 11, like the others have said, it is a signing issue. What fixed it for me was to go to Developer portal > Certificates & Identifiers Edit the provisioning profile you are using

List of certificates Screenshot

You'll see that there's certificate for XCode 11 (as seen on screenshot) Just tick that box, re download the profile, and update your projects signing with the new profile.


I found that I had accidentally changed the provisioning profile to have a wildcard in it.

Ie., it went from com.companyname.appnickname to com.companyname.*

I made a new provisioning profile with the full name correctly named, downloaded it, set the Target->build settings->provisioning profile to that new profile, restarted xcode, got a bizarre error from xcode (it seemed to confuse my various app developer logins), restarted xcode again, and it worked!

I didn't want to delete the existing app, because I was trying to test what happens when a user upgraded their app to a newer version, so I had installed the app store version and then run my xcode with the newer version (which acts like 'upgrading' the app without removing any user data).


Uninstall the main iPhone app, Watch app and build them again solves the problem.


I faced the same problem and was stuck for several minutes and after a search, the simplest solution that i found is just remove the previously installed app from your device manually and try to run the app from Xcode again.

Hope it helps you. All the Best...


Explanation

For me, this issue happened because I have signed in with a different account than the account I have installed the app on the iPhone with.

Solution

Just delete the app from the iPhone and run it again from Xcode.


For the people who might be part of more than one team, this can be your problem:

  • If the app's bundle id is hard coded in your Info.plist then Xcode can get confused and throw this tantrum.

To fix:

  • Make sure that the bundle id is set as:

    $(PRODUCT_BUNDLE_IDENTIFIER)


I tried a few thing myself like updating/making new provisioning profiles, fixing entitlements in Apple Member Center and in project but in my case, I simply had to delete the application and re-run it.

o_O


This application's application-identifier entitlement does not match that of the installed application.

NOTE: it says "...does not match the installed application"

I guess it happened for me because we added a new app extension and there must have been some target related migration issues? Not sure but anyways


I received this error after I moved from a 5s to a 6s. I recovered the new 6s from a backup of the old iPhone. Because of this on the new iPhone the old app was installed.

The old app did not show up in the 6s "Installed Apps" list! I manually deleted this old app from the 6s and everything was fine.


Accepting the pending agreements from the developer website and iTunes Connect website and reopening the project in X-Code solved the situation for me.


I solved this without deleting the app

With the project open in xcode. Project -> Build Settings -> Code Signing -> Provisioning Profiles (drop down) It is probably set to automatic and is choosing the wrong profile. Open the drop down and choose the correct one, then re-run the app.


Steps

  1. With your device connected, and Xcode open, select Window->Devices
  2. Now select the app and download the container using setting icon
  3. Delete the app
  4. Install app again using Xcode
  5. Stop from Xcode
  6. Go to Window->Device and select the app and replace the container that is backup from previous app

Even though I followed some few logical steps: uninstall app, rebuild project, the only solution that worked for me was: restart XCode. (XCode 8.1)


This is solved easily by removing you previous app from your device. And start to reinstall again. This works fine for me.


TLDR - delete the app from the device and run again.

In my case :
1. I compiled and run the app on the iPhone device.
2. I open in the setting the Capabilities and turn on the iCloud
3. Then I try to run the app again, boom, error : "App installation failed This application's application-identifier entitlement does not match that of the installed application. These values must match for an upgrade to be allowed.

4.Then I deleted to app from the iPhone (after I read the answers here)
5.Everything works O.K


The accepted answer didn't work for me. To make it work I had to reset the Apple Watch to the last available backup.


I had this problem and was not able to resolve it without deleting and reinstalling the app (messing with provisioning profiles, as some here suggested, did not help).

However, I did not lose my existing test data. Here's how to do that, for anyone having this problem in the future:

  1. Before removing the app, open the Xcode "Devices" window (that's cmd-shift-2).
  2. Select your device and find your app in the "Installed Apps" list.
  3. Click on the gear icon and select "Download Container...". This will copy all of the app's data to your Mac. Save that somewhere for now.
  4. Delete the app and reinstall it from Xcode. Kill the app from Xcode (click the stop button), so it's not running.
  5. Back in the "Devices" window, click the gear icon and select "Replace Container...". Select the data that you downloaded to your Mac in step 3.

Xcode will then restore your previously saved app data. You now have your old test data back, and the app should run.


I faced the same issue today and resolving it by just changing the Display Name and Bundle Identifier from the previous App that also installed on my iPhone. Steps:

Xcode -> General tab -> Find Identity -> Change Bundle Identifier

So, now I have two same Apps with same functionality but with two different names and identity.


Delete any previous versions of App from your iPhone and then Clean->Build and Run again. Your app should run smoothly on your Device.

Also, please make sure you have not selected Distribution Certificate in your Project Settings while trying to run your project directly on your device.


This can be caused by App ID prefix, when you switching different developer accounts. See https://developer.apple.com/library/content/technotes/tn2311/_index.html for Apple's support.


You will get this error when your AppID prefix does not match the prefix of the previously installed app. If your app is already in the App Store, you will not be able to submit updates without restoring the original AppID prefix or contacting Apple.

Apple's instructions for handling this problem: https://developer.apple.com/library/content/technotes/tn2319/_index.html#//apple_ref/doc/uid/DTS40013778-CH1-ERRORMESSAGES-UPGRADE_S_APPLICATION_IDENTIFIER_DOES_NOT_MATCH_THE_INSTALLED_APP

If you did not intend to change the AppID prefix then Xcode is signing your app with the wrong provisioning profile.

If you do intend to change the AppID prefix (because the app was transferred to a new developer, or you are migrating from an old pre-2011 AppID) you must contact Apple to migrate an existing AppID to a new prefix.

You must also add the previous-application-identifiers entitlement to your app, listing all previous AppIDs (with old prefixes). And you must ask Apple to generate a provisioning profile for you that includes the previous-application-identifiers entitlement.


I had the same error until I restored the watch to factory defaults as per https://forums.developer.apple.com/thread/17948

"Apparently if you have and existing WatchOS 1 app and try to update it to WatchOS 2 the bundle identifier changes and causes this error. If you update your watch you will need to do reset it if you had installed WatchOS1 app before updating that app to WatchOS2."


I encountered this issue because I built to the phone with my code signing turned off from another machine, so you need to uninstall the app from the phone before installing/building to the phone with code signing on.


My problem was the App ID in combination with the certificate used to create the provisioning profiles. None of my provisioning profiles were working because none of them were "Elgible" (created with a certificate that matched the App ID). I had moved development to a new machine, so perhaps this was the deeper reason. At any rate I had to create a new certificate, then new provisioning profiles with that certificate being careful to choose the right App ID when creating them. Good luck.