Xcode 8.0 - App Installation Failed - The executable contains an invalid signature - ios

Made an app called MyFirstApp in Xcode 8.0 and I was ready to test it on my iPhone 6s. Plugged it in with the lightning cable it came with and pressed Window > Devices > iPhone 6s. Went down to the Installed Apps section pressed the + and selected the built application. Received the error "App Installation Failed - The executable contains an invalid signature."
Under the general tab for the app project I have "Automatically manage signing" checked with my name selected as the Team.
Provisioning Profile: Xcode Managed Profile
Signing Certificate: iPhone Developer (my name) (############)
Tried Product > Clean and Product > Build.
It feels like I'm doing something wrong, but I don't know what my options are for fixing this. I'm building this in Swift 3 if that matters.

ok I somehow stumbled across a fix.
Product > Destination > my iphone.
Then I pressed the run button. It asked if I wanted to add my phone as a valid developers device. After pressing yes, it then asked me 700 times to validate the app was ok to place on the phone.
Very strange I couldn't just press to send the app to the phone, but this works. If anyone has anything to add please do. This was a very confusing process for me.

This error indicates that an App Store distribution provisioning profile was mistakenly used to sign the Ad Hoc build. Please note that builds signed with an App Store distribution provisioning profile cannot be installed onto development or testing iOS Devices; they can only be submitted to iTunes Connect for App Review. To resolve this issue, sign the app with an Ad Hoc distribution provisioning profile instead.
https://developer.apple.com/library/content/technotes/tn2319/_index.html#//apple_ref/doc/uid/DTS40013778-CH1-ERRORMESSAGES

I have cleaned, rebuilt, uninstalled and reinstalled the app again. It fixed the problem for me.

I installed AppSync Unified from Cydia and it worked. However, this method requires a jailbreak.

Related

Beta from Crashlytics fail to install build on testers' devices

I'm sending my app to testers with Beta from Crashlytics which is an amazing tool to do app testing.
I had every new tester's device UDID registered in my developer account and then distribute a new build.
My testers got email invitation and accessed app's installation which could not be completed on their device.
They kept seeing an alert showing up with message:
Unable to download app - MyApp could not be installed at this time -
Done / Retry
Testers' testing status are "installed" in my Crashlytics dashboard but they're actually not able to finish installation.
Please help me find any possible factor causing this problem.
Perhaps the provisioning profile embedded in the build has been invalidated. Use Xcode to create a new archive, then use Fabric to upload a new build with that archive.
Discussion:
In my case, I had deleted the provisioning profile in the Apple Developer Member Center that had been embedded in each of my Fabric Beta builds. This caused the app testers had previously installed to immediately crash when they tried to launch it (embarrassing). It also caused the "Unable to download app - MyApp could not be installed at this time - Done / Retry" issue when testers tried to (re)install the app via Fabric Beta. Uploading a new build with my new provisioning profile embedded fixed the issue (each tester had to install the new build).
I've run into this problem back on iOS8 and just recently saw it again for iOS9, the only thing that solved the install issue was for my users to delete any previous version that they had downloaded, restart their phone, and try again.
You can also verify with them if Crashlytics properly installed on their iDevice, I've seen more than once where the configuration profile caused the issue, it's worth removing that (Settings -> General -> Configuration Profile (towards the bottom)) and retrying the install.
This is usually caused by one of two problems:
Incorrect provisioning profile/code signing settings. Double- and triple-check that the following settings are the same for the project and the provisioning profile: bundle identifier, development vs. distribution, adhoc.
Caching - sometimes, even when you've done everything correctly, things still just go awry. In such cases, you can try: deleting the previous version of the app from your phone, cleaning your project, deleting and re-downloading provisioning profiles, and building the app again.
RubyMotion Solution
For me, it was because I was using a development distribution profile, but with the wrong entitlements. Well, entitlement, singular.
I still had the 'beta-report-active' entitlement enabled, which was not included with the development distribution profile I am using. It is instead included with the production distribution profile (which is needed to distribute to TestFlight). However, I just wanted to deploy to my local phone, and not air my dirty app laundry to my entire internal test group, so this is where I found myself.
In any case, removing the 'beta-report-active' entitlement fixed my issue.
I tried the normal route of checking for proper certs and also deleting the app and provisioning profile along with rebooting device. In my case it was installing on device A and not device B. Device A was older iPhone 5c running iOS 9 and device B was newer iPhone 8 running iOS 11.x. When I archived the app for distribution I was selecting device A during the archive. Once I selected "Generic Device" it worked. But I'm sure I've built in the past selecting a specific device instead of generic and it worked. I was using Xcode 8.2, but I don't believe the Xcode version matters.

iOS 8 TestFlight does not install app

So as the title says, I am trying to pre-release an ios8 app. The app is uploaded successfully from the archive and appears under pre-release. I press on submit for beta release and add internal test users. In testflight the app appears, but when I press install it says:
"Could not install app, testflight is currently unavailable. Try again later".
This makes no sense. I tried recreating the developer profiles, I tried it on different devices with different account... always the same. Any ideas?
I re-downloaded the distribution profile for the app and re-archived the app. Now TestFlight works. Make sure that you select a Distribution profile (not Development)
Full description with pictures ... https://stackoverflow.com/a/30801899/294884
I had the same issue with one application for internal users... This worked for me:
Go to Prerelease -> Builds
Turn Off Beta Testing
Refresh testflight at your device (Build will appear as unavailable)
Turn On Beta Testing
Refresh Testflight at your device and install
Same error. My provisioning file was inactive in iOS developer portal as my certificate was revoked by other developer. I'd to activate the provisioning file with new certificate (exported from keychain by that very developer). So, I'd to use these new provisioning and cert to archive my app.
None of the solutions worked for me. I had the problem, that I couldn't update the gems version (an earlier version was already installed) with the same error message.
Turns out, re-inviting the affected user solves the problem.

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.

App stuck on installing ipa from iTunes

Since moving to ios7 I am unable to distribute my app to my iPad using the ipa and provisioning profile (the same ones that worked just before I upgraded to ios7 do not work either).
This is what I have tried:
Remove all profiles from iPad
Deleting existing app from iPad and iTunes
Add ipa and prov profile to iTunes
Reinstalled app from iTunes
The app installs on the iPad saying 'installing' until it appears to have loaded and the app name is shown below the icon. However in iTunes it still says 'installing' and never changes to 'remove'.
If I then unplug the iPad and tap the app to start it it reverts back to 'installing' and then nothing else happens.
You most likely built your archive with an App Store provisioning profile instead of an Ad-Hoc Provisioning profile
Here are the steps that seemed to fix the problem for me:
Deleting all profiles from device (iPad in my case)
Settings - General - Profile
delete any relating to your app
Deleting all profiles from iTunes on iMac
Finder - Library (GO with ALT pressed displays this) - Mobile Device - Provisioning Profiles
delete all provisioning profiles you see here. This is where Xcode sees any when choosing your profile.
In Xcode - in both Projects and Targets
Set all code signing to None
Archive your project - in Xcode Product - Archive
You will be told no profiles exist - choose Fix Issue. Your provisioning profiles will be downloaded into the Library - Mobile Device - Provisioning Profiles (the folder we previously cleared.) In future these will be your options when setting your Project and Target code signing.
In Organiser
Export your archived product and choose the team Profile (or any that have been downloaded) as code signing.
Drop the ipa into iTunes and install.
For Ad Hoc provisioning - check the device UDIDs.
We used an app called UDID+ to get the device UDIDs. Don't! The app gives you the wrong UDID with iOS7.
Apple's developer site accepted the faulty UDIDs and everything proceeded normally until the issue described above occurred. It took a looong time and lots of starting from scratch to figure that one out.
I had the same problem. I had archived with the wrong code signing identity selected in XCode. Changing that and creating a new archive solved it straightaway.
I just did 'clean' and 'build' in the xcode product menu (then archive, export ipa, etc) and it works now.
I had a similar issue and turned out the reason was because I was trying to distribute an .ipa file without first adding the recipient device UDIDs to my developer account settings. It used to be possible in some earlier iOS versions to distribute an .ipa without adding the UDIDs but apparently not anymore. More info here: https://developer.apple.com/library/content/documentation/IDEs/Conceptual/AppDistributionGuide/TestingYouriOSApp/TestingYouriOSApp.html
And I also needed to change the code signing settings from Xcode from "iPhone developer" to "iPhone distribution".

provisional profile is not found for the device

I know that it has been asked a thousands of times, but I am struggling 4 hours with every possible sollution I read but still I cannot beta test my app in my device.
Here are the facts:
1) My app is uploaded in the IOS store, so I have created a provisioning profile, app id's and so on. I just now want to test it in my iPhone4, with target iOS 6.0.
2) I added my device UDID in the devices, in my developer account.
3)I set the code signing for debug to my provisioning profile.
4) I plugged in my ios device in the mac and I see that picture.
As you can see there is no provisioning profile.
5)If I run the app to my ios device (which is listed in the Xcode) I get the error
No provisioned iOS devices are available with a compatible iOS version.
I tried so many solutions that I found that I cannot even remember all of them. I am following all the steps one by one.
-someone said to log out from developer account
-other said to change deployment target
-other said to change the "edit scheme" to debug.
Can anyone help me? I do not understand what is missing since app is published and I only want to test it in my device. Should I change anything else?
EDIT: I selected the device as Ganee said. Then in my organiser I see the following picture:
If I press refresh, I see "Too few items in team".
So If I remove the provisioning profile, how do I download the new one? I suppose I enter my developer account and press download in the distribution profile under the provisioning tag, right? But is this updated with the selected device?
Here is my picture from the developer account:
I think you followed all steps, but still you have to conform the following steps.
After you added device to developer account, you have to select that device in your provisioning profile.
Remove old profile from your organiser, download new modified profile and install it on your Mac.
Please check wether you modified developer/ distribution profile and select it on your xcode.
Hope this will give some clarity.
I remember having similar problem in the past. I am not sure if yours is similar. But awhile back when I upgraded my iOS device, it was no longer compatible with the xcode version I was running. I had to upgrade to the latest version of xcode. What is Xcode version are you running?
Finally the problem was that I had a distribution profile set up, and not a developer. Thanks for the help!

Resources