ChatGPT解决这个技术问题 Extra ChatGPT

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.

https://i.stack.imgur.com/tHqUy.png

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.

Were you able to find the fix?
Yes, the answer from @john-nesbitt did the trick
As to 'why' it happens (might be helpful to list), in my case, on developer account change. Was installed on account A and was trying to run after changing to account B. (I do not have entitlement file in the project).
Check out the second answer first, it is more comprehensive and won't result in data loss.

J
John Nesbitt

I had this problem with an iPhone app, and fixed it using the following steps.

With your device connected, and Xcode open, select Window->Devices

In the left tab of the window that pops up, select your problem device

In the detail panel on the right, remove the offending app from the "Installed Apps" list.

After I did that, my app rebuilt and launched just fine. Since your app is a watchOS app, I'm not sure that you'll have the same result, but it's worth a try.


That will erase the app and all it's content. I need to upgrade and not loose all my data in the process if possible.
So you deleted the app
My app wasn't displayed in the Windows->Devices list, but I deleted it from the phone (by pressing and holding on the icon) which fixed the problem. Thanks John.
I want to test app migration to the new version, and I can't do that if I delete existing app (AppStore version) from the device.
Do this instead. 1) Pick up your iOS device. 2) Find a large body of water. 3) Throw the iOS device from step 1 into the large body of water from step 2. Now buy another iOS device, set it up, and the app will rebuild and launch just fine.
T
Tom Harrington

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:

Before removing the app, open the Xcode "Devices" window (that's cmd-shift-2). Select your device and find your app in the "Installed Apps" list. 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. Delete the app and reinstall it from Xcode. Kill the app from Xcode (click the stop button), so it's not running. 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.


This works particularly well when using the "automatic provisioning" feature in Xcode 8.
I truly wish that I had read this before using the answer. Then the state data would have been preserved. (See my comment above).
This should be the selected answer.
100% the right answer IF YOU DON'T WANT TO LOSE YOUR DATA. Should be accepted answer.
I have same scenario but my useful data is in Userdefaults Can we recover that anyway? Help is appreciated
n
n.by.n

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.


D
Darren

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.


My wildcarded profile that I used for development expired and I mistakenly created an app-specific one. After reading your post, I created a new wildcarded profile and used it. Worked like a charm. Yours is the most accurate post and should be the accepted answer. Deleting the app and losing the data is not a good option for many of us. Thanks!
D
Dustin

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.


I at first tried deleting and reinstalling the app. Didn't work. Then I scrolled down and saw this answer. The build was failing with this error only for automated UItests but not for the regular build, and it turns out the right provisioning profile was selected for the regular build but not the automated UItests build. So, updating that fixed the problem..
K
Kunal Gupta

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...


Yes! If the app is offloaded then you must remove it by hand - won't find it in Xcode.
K
Kirit Vaghela

Steps

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


Container steps are not necessary but nice if you wish to maintain the data. Thank you.
E
Essam Fahmi

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.


w
wzzhu

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.


s
staticVoidMan

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


yes, delete the installed app in your device and re-run from Xcode. I had this problem because I added a target in Xcode.
a
arinmorf

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).


You just need to make sure you are using the same Provisioning profile you originally built the app with.
F
F_Boris

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.

https://i.stack.imgur.com/P0ClZ.jpg


This doesn't work if you would like to test an app update.
By changing the bundle ID, you've effectively created a brand new app.
R
Rawand Saeed

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.


o
oOEric

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


P
Piotr Farbiszewski

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 also had to restore the watch to factory defaults. Had tried all the other relevant suggestions, but to no avail. Had also regenerated all the provisioning profiles to make sure they were consistent with the entitlements. My situation was just as described here: Had an existing WatchOS 1 app, that I was trying to update to WatchOS 2.
I
Ispas Claudiu

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)


K
Kelsey

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


h
hoptown

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.

https://i.stack.imgur.com/FnUYv.jpg

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.


u
user1105951

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


J
Juan Carlos Ospina Gonzalez

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)


佚名

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


R
Ronald Hofmann

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.


g
gollumullog

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.


R
RedBassett

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


I
Irfan

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.


K
Keuha

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.


A
Alyoshak

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.


N
NEOline

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.


V
Vishal Chaudhry

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


m
marvios

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.