Crashlytics: "MyApp could not be installed at this time" when adding entitlements - ios

I'm trying to distribute a beta version through Fiber/Crashlytics. I've been doing this for ages but this time I'm unable to make it work correctly (iOS9+).
My app uses icloud keyvalue store, IAP and push notifications, so it has an entitlements file. The thing is, when I archive and distribute the app, Crashlytics sends the email with the new version to testers and they are able to install it BUT, as soon as it ends installing, a "…could not be installed at this time" appears and the app deletes itself. In the other hand, if I remove the "code signing entitlements" value from Building Settings, the installation works ok (but icloud and other things aren't working, of course).
What am I doing wrong? Is there a workaround for this situation?

It turns out that the entitlements file had something wrong (even when I've never edited it by myself!). I had enabled and disabled the required capabilities trying to fix my problem but it didn't worked until I deleted the entitlements file and forced Xcode to recreate it by enabling capabilities again.
After that, I've hadn't any problem to archive and distribute my beta.

Related

Profile doesn't include aps-evironmentProd, Xcode 10.1

I am trying to start my app on a device and faced with this. It doesn't depend on signing method. Push notifications feature enabled for the App ID in Developer account, valid APNS certs added. On the capabilities tab everything is OK.
I know what is aps-environment (this string presents in generated profile), but what does Xcode mean by environmentProd string? I can't find out just anything about "aps-evironmentProd".
The application started without any troubles on previous Xcode versions. For me it seems like regular Xcode bug. How can I handle this without Xcode downgrade?
Entitlements
It seems you have changed/updated APS Environment to APS EnvironmentProd in your .entitlements file.
Check your .entitlements again to be sure. If not just restart Xcode.
Also, I am assuming you already know following:
No need to update development to production in.entitlements`. Because we can't use the production certificate in debug/development.
When we do 'Archive' Xcode automatically set it to production.
I see this is old question but still I wanted to provide an answer as I had same problem.
I did try so many options, recreated provisions, certificates edit manually entitlements and nothing worked.
At the end I created new project with same name as my original app did all setup a nd there was no eny error for entitlements.
I have Uploaded app into appstoreconnect and tested all worked fine.
Then I copied entitlements file and appdelegeate into my original app and no errors after.

iOS app upload to iTunes Connect results in Invalid Signature issue

I'm working on a hybrid mobile app project (Ionic framework) and releasing to Android, iOS and web. This issue concerns only releasing the application on iOS.
I ran into an issue whereby I suddenly started getting the following email from iTunes Connect after building, archiving and uploading my iOS app to App Store from Xcode.
App Store Connect: Your app "YourAppName" (Apple ID: XXXXXXXXXX) has
one or more issues
Dear Developer,
We identified one or more issues with a recent delivery for your app,
"YourAppName". Please correct the following issues, then upload again.
Invalid Signature - A sealed resource is missing or invalid. The file
at path [YourAppName.app/YourAppName] is not properly signed. Make sure you
have signed your application with a distribution certificate, not an
ad hoc certificate or a development certificate. Verify that the code
signing settings in Xcode are correct at the target level (which
override any values at the project level). Additionally, make sure the
bundle you are uploading was built using a Release target in Xcode,
not a Simulator target. If you are certain your code signing settings
are correct, choose "Clean All" in Xcode, delete the "build" directory
in the Finder, and rebuild your release target. For more information,
please consult
https://developer.apple.com/library/ios/documentation/Security/Conceptual/CodeSigningGuide/Introduction/Introduction.html
Best regards,
The App Store Team
I tried everything I could find on the internet regarding this issue:
Checking over my certificates, provisioning profiles, recreating them, updating Xcode, building the project again, made sure I'm using a distribution certificate not an ad-hoc certificate, verified the code signing settings in Xcode were correct, verified the bundle was built using the Release target, tried the "Clean All" option, deleted the "build" directory in the finder and rebuilt the release. In short - I tried everything I could find by Apple regarding this issue, also looked up the same issue in StackOverflow and tried a huge variety of the recommended solutions. I tried all of those options multiple times over to make sure I didn't miss anything.
Nothing worked...
Also a note that I was able to upload to App Store without any problems before. There hasn't been any changes to the project which could result in this Invalid Signature issue arising - no certificates have expired, no new ones have been created, no new provisioning profiles have been created. The same profiles and certificates were used which worked just fine some time ago. iTunes Connect just suddenly started responding with this issue.
What else can I try?
I was sceptical at first when I tried this solution but this actually solved my issue.
Find a spare USB stick or an external hard drive.
If your Mac's filesystem is APFS format the external volume using a HPFS Mac OS Extended (Journaled) file system. Move your project over to the freshly formatted HPFS external volume and rebuild it over there. This is important as if you build it on your Mac's APFS volume and then move it over to your HPFS external volume to archive and upload in Xcode this will not work!
The project needs to be built, signed, archived and uploaded ON the HPFS volume.
The uploading to App Store should now work again. It worked for me, hope it works for you as well.
See more information on the solution here

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.
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.
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.
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.
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.
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 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 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...
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
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.
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.
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 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).
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.
This happened when I tried installing over top of an adhoc build.
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.
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.
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.
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."
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)
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
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.
Uninstall the main iPhone app, Watch app and build them again solves the problem.
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.
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.
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.
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.
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.
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.
Accepting the pending agreements from the developer website and iTunes Connect website and reopening the project in X-Code solved the situation for me.
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.
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).

iOS app 'The application could not be verified' only on one device

I have two iphone devices( 4s and 5 ) connected to my computer and i am trying to install an application in both the devices. It installs pretty well in iphone 5 but it gives an error 'The application could not be verified.' when attempted to install in the iphone 4s device.
The UDIDs of both the devices have been added in the provisioning profile generated for the application.
Also, to add a note, I have just updated my iphone version to 8.1.3 in my 4s device. I am not sure though if the error has anything to do with it.
Any help on this would be much appreciated. I have been stuck on this for some time now.
EDIT:
I just connected this to another iPhone device and the issue seems to be there again. Basically this means that the app, for some reason, installs only in the phone which I have been using for some time now and not in any other phone. Once again, I am pretty sure that the provisioning profile contains the UDIDs of all these 3 devices.
I had something similar happen to me just recently. I updated my iPhone to 8.1.3, and started getting the 'application could not be verified' error message from Xcode on an app that installed just fine on the same iOS device from the same Mac just a few days ago.
I deleted the app from the device, restarted Xcode, and the app subsequently installed on the device just fine without any error message. Not sure if deleting the app was the fix, or the problem was due to "the phase of the moon".
As I notice The application could not be verified. raise up because in your device there is already an app installed with the same bundle identifier.
I got this issue because in my device there is my app that download from App store. and i test its update Version from Xcode. And i used same identifier that is live app and my development testing app. So i just remove app-store Live app from my device and this error going to be fix.
just delete the app and try again, it happens to me when i try to launch over a device that has the same app but generated by an ipa file.
You probably used the "Fix Issue" option in Xcode when plugging in a new device. Old question but I believe this is the actual answer to WHY this is happening. When you install an app on a device it is signed with a specific development provisioning profile. If, for instance, you plug in another device that is not registered on your developer account Xcode will ask you to "fix the issue". When you press that the device is added and another provisioning profile is created/modified. If you try to overwrite an existing app you'll receive that error. Deleting the app and reinstalling it works since the profile has been altered. I find this often happens when a Team is set and a member plugs in a new device then Xcode "Fixes" the problem.
Might have figured it out... Deleting the app from the device worked for me, as others mentioned before (thanks!).
I think the reason is that the app on the device was actually signed with a separate provisioning profile, specifically a distribution profile in my case.
I faced this issue a lot. I am not sure if this is the issue, but I think, when xCode saw that there is an app with the same bundle identifier as of the app, I am trying to install, it didn't allow me. So, I had to delete the older one and attempted to install and it worked. However sometimes for testing purpose, I needed multiple version of the same app and in that case, I would change the bundle identifier and try to install. It only works if, I am using an wildcard provisioning profile.
To others not using RubyMotion and don't think that deleting the app is acceptable (as in, you want to do upgrade testing). Check out the bottom of these docs from Apple:
https://developer.apple.com/library/ios/technotes/tn2319/_index.html
It looks like they changed something in 8.1.3 to check for this new rule.
The Fix
"[Add] the installed application’s application-identifier value, as logged in the second parentheses, to the previous-application-identifiers entitlement’s array value for the app being installed (by resigning it or re-building it) and requesting new special provisioning profiles as shown below."
<key>previous-application-identifiers</key>
<array>
<string>{Your Old App ID Prefix}.YourApp.Bundle.ID</string>
</array>
EDIT:
In order to do this, you need special provisioning profiles. You can request these from Apple:
"To enable signing with the previous-application-identifiers entitlement new special provisioning profiles are required that can be obtained by going to the Contact US page and requesting them." (from the docs linked above).
Had the same issue on my iPad running 8.1.3 Deleting the app and installing again fixed the issue. I use two different provisioning profiles on two different machines and that could have caused this issue.
Working & tested solution, which does not require to delete application:
It looks like AppStore Distribution Provisioning Profile or just iOS Distribution certificate have special permissions and "Could not be verified..." problem does not apply to them. They will always override previous certificate.
In other words: AppStore release will install successfully, even if already installed (testing, adhoc or enterprise) app has been signed by the certificate from different team.
If you are lucky and have previously uploaded app to the AppStore account owned by the same team as in certificate you have a problem with - then things are very simple: just download & install app from AppStore.
When it installs - app certificate will be the same as the one you want to test with and problem goes away.
If your app is not on the AppStore yet - iTunesConnect beta comes to the rescue:
Disclaimer: I did not tested this but since cert an prev are the same as AppStore release, I bet it works:
Archive your app with AppStore provisioning profile (iOS Distribution cert) and upload to iTunesConnect (to the account owned by the same developer team as included in the provisioning profile not you want to run).
Invite person with the device you want to run on (yourself?) to beta test.
Download & install the app from iTunes connect beta.
Now you are able to install your testing version.
The application could not be verified" , in your device there could be already an app installed with the same bundle identifier.
So Simple solution Just delete the App & try again..
....
TL;DR answer - There is no real solution besides "delete app and reinstall".
This answer is not satisfactory for many situations, when you have an existing database that needs to not get deleted within the app.
Lukasz and plivesey are the only ones with solutions that don't require delete, but neither worked for me.
I resolved this issue by changing the Build System to legacy in xcode.
I had the same problem but the mentioned solutions above didn't work for me. Even I had no previous app on device, I got this error when deploying on my device.
How to do:
Simply, go to menu File > Project Setting, inside Share Project Settings, change Build System from "New Build System (default)" to "Lagacy Build System".
I also encountered the same issue. Deleting the app didn't work, but when I tried deleting another app which was the current one's 'parent'(I copied the whole project from the previous app, modified some urls and images, then I clicked 'Run' and saw the unhappy 'could not be verified' dialog). Seems the issue is related to provisioning and code signing and/or some configurations of the project. Very tricky.
I had changed the team but I forgot to change it in my Tests target it so it caused that. Maybe this helps someone.
Just had the same problem and I found out that the issue is with expired certificate.
My app was distributed (AdHoc) through firebase and few days ago app was working just fine.
Today I've realized that I can't install it because 'The application could not be verified'.
Finally I realized that certificate that I was using for app signing has expired 2 days ago.
You need to upload it again and you'll be able to install it.
I had the same problem. But, I realised I was using a single plist with (debug) and (release) configuration, like this.
So, I changed few things..
Keeping a separate scheme for (release).
I added a new scheme for development purposes.
Edited the new scheme > run > Build Configuration > and set it to (release)
Generated a new archive using the new scheme and voila!!..
I'm able to install on all my devices.
My case:
jailbreak'ed iPhone
Final solution:
Install tweak AppSync Unified via Cydia
to bypass signing/certificate verification
Same issue occurred for me when I was installing through link. I tried to install using different link. Then I could install the app.

taskgated: killed app because its use of the com.apple.developer.ubiquity-container-identifiers entitlement is not allowed

So, create a vanilla project, build & run... App does not appear. Open console:
"1/10/12 6:32:29.967 PM taskgated: killed com.myapp.TEST[pid 28092] because its use of the com.apple.developer.ubiquity-container-identifiers entitlement is not allowed"
Pretty much the same question as here
Turning Entitlements on in Xcode Prevents Bare Bones App From Launching
And here.
Mac application crashes (killed due to entitlements) regardless of whether entitlements are enabled
I am not using iCloud. In fact I haven't even changed the default project. Any solutions or ideas? Thanks to anyone who has overcome this.
It turns out, from the docs even, that the XCode "default provisioning profile" which it automatically creates and updates ALSO includes iCloud permissions. Since those permissions are app specific, presumably this breaks every app using the default xcode profile.
I'm not sure why this isn't an epidemic, but in my case it meant that instead of using the "XCode wildcard app id", I had to create a new "basic wildcard app id" without iCloud. Using this and creating a new provisioning profile, adding it, etc, worked. It means I can't let XCode handle the profiles anymore :(
I was able to make this work by going into the provisioning portal, disabling iCloud on my wildcard App ID, going back to Xcode, and refreshing the provisioning profiles list.

Resources