App installation failed: Unknown Error Xcode 7 - ios

My app runs fine in the simulator, but when I try to install it on my iPhone it says
App installation failed: An unknown error has occurred.
I opened my device logs and got this:
Nov 12 21:17:19 Isaacs-iPhone streaming_zip_conduit[5853] : LaunchServices: installing app for existing placeholder Raritea.FSS-App <(null) Not found in database>
Nov 12 21:17:19 Isaacs-iPhone streaming_zip_conduit[5853] : LaunchServices: Not creating progress for Raritea.FSS-App <(null) Not found in database> since it is not a placeholder.
Nov 12 21:17:19 Isaacs-iPhone installd[4549] : 0x16e1bb000 -[MIClientConnection installPath:withOptions:completion:]: Install of "/var/mobile/Media/PublicStaging/FSS App.app" type Developer (LSInstallType = (null)) requested by streaming_zip_conduit (pid 5853)
Nov 12 21:17:19 Isaacs-iPhone installd[4549] : 0x16e12f000 -[MIInstaller performInstallationWithError:]: Installing
Nov 12 21:17:20 Isaacs-iPhone profiled[4644] : (Note ) MC: Provisioning profiles changed
Nov 12 21:17:20 Isaacs-iPhone profiled[4644] : (Note ) MC: Updating MIS trust...
Nov 12 21:17:20 Isaacs-iPhone securityd[4588] : secTaskDiagnoseEntitlements MISSING keychain entitlements: no stored taskRef found
Nov 12 21:17:20 Isaacs-iPhone securityd[4588] : secTaskDiagnoseEntitlements MISSING keychain entitlements: no stored taskRef found
Nov 12 21:17:20 Isaacs-iPhone installd[4549] : SecTrustEvaluate [leaf IssuerCommonName SubjectCommonName]
Nov 12 21:17:20 Isaacs-iPhone profiled[4644] : (Note ) MC: Provisioning profiles changed
Nov 12 21:17:20 Isaacs-iPhone profiled[4644] : (Note ) MC: Updating MIS trust...
Nov 12 21:17:20 Isaacs-iPhone installd[4549] : unrecognized status -67049 from codesigning library
Nov 12 21:17:20 Isaacs-iPhone installd[4549] : 0x16e12f000 +[MICodeSigningVerifier _validateSignatureAndCopyInfoForURL:withOptions:error:]: 142: Failed to verify code signature of /private/var/mobile/Library/Caches/com.apple.mobile.installd.staging/temp.FvOJz0/extracted/FSS App.app/PlugIns/QuickSched.appex : 0xe8008001 (An unknown error has occurred.)
Nov 12 21:17:20 Isaacs-iPhone installd[4549] : 0x16e12f000 -[MIInstaller performInstallationWithError:]: Verification stage failed
Nov 12 21:17:20 Isaacs-iPhone streaming_zip_conduit[5853] : 0x16e087000 __MobileInstallationInstallForLaunchServices_block_invoke222: Returned error Error Domain=MIInstallerErrorDomain Code=13 "Failed to verify code signature of /private/var/mobile/Library/Caches/com.apple.mobile.installd.staging/temp.FvOJz0/extracted/FSS App.app/PlugIns/QuickSched.appex : 0xe8008001 (An unknown error has occurred.)" UserInfo={LibMISErrorNumber=-402620415, LegacyErrorString=ApplicationVerificationFailed, SourceFileLine=142, FunctionName=+[MICodeSigningVerifier _validateSignatureAndCopyInfoForURL:withOptions:error:], NSLocalizedDescription=Failed to verify code signature of /private/var/mobile/Library/Caches/com.apple.mobile.installd.staging/temp.FvOJz0/extracted/FSS App.app/PlugIns/QuickSched.appex : 0xe8008001 (An unknown error has occurred.)}
Nov 12 21:17:20 Isaacs-iPhone streaming_zip_conduit[5853] : ERROR: MobileInstallationInstallForLaunchServices returned nil
Nov 12 21:17:20 Isaacs-iPhone streaming_zip_conduit[5853] : __dispatch_source_read_socket_block_invoke:274: Failed to install application at file:///var/mobile/Media/PublicStaging/FSS%20App.app/ : Error Domain=LaunchServicesError Code=0 "(null)" UserInfo={Error=ApplicationVerificationFailed, ErrorDetail=-402620415, ErrorDescription=Failed to verify code signature of /private/var/mobile/Library/Caches/com.apple.mobile.installd.staging/temp.FvOJz0/extracted/FSS App.app/PlugIns/QuickSched.appex : 0xe8008001 (An unknown error has occurred.)}

This line in the device logs stood out to me, and hopefully you saw it too:
Failed to verify code signature of /private/var/mobile/Library/Caches/com.apple.mobile.installd.staging/temp.FvOJz0/extracted/FSS App.app/PlugIns/QuickSched.appex
This is saying that (although Xcode thought everything was OK at build time), your device rejected the code signature of your app extension.
There are a few solutions here, but in my personal experience, this issue can only be fixed by tinkering with the code signing settings for your app and app extension. Make sure that the app and app extension are being signed with the same certificate (although likely different provisioning profiles).
As others have recommended, I've also been able to fix this by running the Clean action in Xcode for the project, and also by deleting the derived data directories. But I have not always been successful with this.

This happened to me before. I had to navigate to derived data and delete it. Restart Xcode. Solved the issue for me. You may want to restart your computer as well.

I have had luck by disconnecting my iPhone from my mac, and then Analyzing (Shift + Command + B or Product -> Analyze).
After that I plugged my iPhone back in and did a clean (Command + k) and then ran! Worked!

I spent a long time on this issue. Doing the following in XCode finally resolved it for me. Some of this is mentioned already, but no.4 finally resolved it for me.
Product > Clean Build Folder (Cmd+Shift+K)
Project > Target (Project) > Build Settings, and check if path of "Info.plist" file is same as the path you get if you right click on the file > Show file inspector > location="Relative to Project"
Disconnect Phone & restart laptop & restart phone
Project > Target (Project) > Build Settings, and ensure "Excluded Architectures" is empty. Mine had arm64 in excluded architectures for some reason.
Hopefully this helps.

I had the same problem but with an app without app extension on XCode 10.2.1.
None of the solutions worked for me, so I deleted the XCode target and recreated it with the same files and settings. This worked for me.

try it :
Xcode-> Preferences->Locations->Derived Data-> Delete it...
It will clean your project,
Try to restart your device.
Then build the app on the device.

I also had this problem, in device log it said that code signing failed for my app extension ....appex. I went to my App Target -> Build phases -> Embed App Extensions and checked Copy only when installing, after that I could install the app on the phone.

This worked for me :
1) Product > Archive (From Xcode)
2) Export iPa
3) Install this iPa from iTunes or Diawi.

Related

Unable to install enterprise app - This provisioning profile cannot be installed on this device

I'm setting up Jenkins to build an enterprise version of an app in order to be distributed in our internal app store.
If I archive the app in Xcode and then download the built .ipa on the phone the app is installed without any issue; but when I use the .ipa generated with Jenkins with the same private key/certificate/provisioning profile, installation fails with the following error: "Unable to Download App - App name could not be installed at this time"
If I check the console in Xcode I can see some more details errors as "This provisioning profile cannot be installed on this device"
Here is part of the log
<Notice>: 0x16e12f000 -[MIInstaller performInstallationWithError:]: Installing <MIInstallableBundle ID=af11a784-f15d-4291-92a1-0e0c54fc4ee9; Version=13, ShortVersion=0.0.1>
<Notice>: attempt to install invalid profile: 0xe8008012
<Error>: 0x16e12f000 -[MIInstallableBundle _installEmbeddedProfileInBundle:]: Could not install embedded profile: 0xe8008012 (This provisioning profile cannot be installed on this device.)
<Error>: 0x16e12f000 MIMachOUnhideArchsSavingOriginalHeader: Failed to open "/private/var/mobile/Library/Caches/com.apple.mobile.installd.staging/temp.YMpQfe/extracted/Payload/appName.app/appName": No such file or directory
<Error>: 0x16e12f000 -[MIInstallableBundle performVerificationWithError:]: 696: Failed to unhide archs in executable file:///private/var/mobile/Library/Caches/com.apple.mobile.installd.staging/temp.YMpQfe/extracted/Payload/appName.app/appName
<Error>: 0x16e12f000 -[MIInstaller performInstallationWithError:]: Verification stage failed
<Error>: 0x16e247000 __MobileInstallationInstallForLaunchServices_block_invoke222: Returned error Error Domain=MIInstallerErrorDomain Code=14 "Failed to unhide archs in executable file:///private/var/mobile/Library/Caches/com.apple.mobile.installd.staging/temp.YMpQfe/extracted/Payload/appName.app/appName" UserInfo={SourceFileLine=696, NSLocalizedDescription=Failed to unhide archs in executable file:///private/var/mobile/Library/Caches/com.apple.mobile.installd.staging/temp.YMpQfe/extracted/Payload/appName.app/appName, FunctionName=-[MIInstallableBundle performVerificationWithError:]}
<Warning>: ERROR: MobileInstallationInstallForLaunchServices returned nil
Anyone any idea?
This has nothing with provisioning. Offending line Failed to unhide archs means that you're not compiling for given architecture (armv7 or arm64 depending on the device you install to).
I had also different errors like
Failed to unhide archs in executable file
as well as
error MT0000: Unexpected error
or
Error: error MT1006: Could not install the application
or
AMDeviceSecureInstallApplicationBundle returned: 0xe800801c
Now I got it running again after:
Cleaning solution
Deleting content of obj/bin folders
Multiple restart of devices (Mac, iPad, PC, ...)
In general, I recommend to update you development/build environment and to also check your certificates.

Could not inspect the application package

I have final version of XCode 6 (version 6.0.1). In my project, I have problem when running it.
I got
"App installation failed - Could not inspect the application package."
If I run project again, it runs ok. Another run, problem again... etc. So every second run ends in this error, right after that application run just fine.
I have no problem in XCode 5.
If you have moved or copied a folder named resources or resource into your project, try renaming it. Then perform a clean.
I had the same issue, And was unable to install the ipa. It always ended with an error "Could not inspect the application package." and some warnings in device console
Feb 10 17:38:16 iPhone mobile_installation_proxy[356] <Warning>: LaunchServices: Please include the kCFBundleIdentifierKey in the options dictionary when installing an app.
Feb 10 17:38:16 iPhone mobile_installation_proxy[356] <Warning>: LaunchServices: installing app with unknown bundleID
.
.
Feb 10 17:38:16 iPhone installd[44] <Error>: 0x101bcc000 -[MIBundle _validateWithError:]: 28: Failed to load Info.plist from bundle at path
Feb 10 17:38:16 iPhone installd[44] <Error>: 0x101bcc000 + [MIInstallable installablesAtURL:packageFormat:userOptions:error:]: Failed to create bundle for …
After spending hours, I got it fixed by adding the "Application requires iPhone environment" in info.plist
<key>LSRequiresIPhoneOS</key>
<true/>

iOS Provisioning Profile - Cannot install (developer cert trust result = 5)

I recently generated a new certificate and provisioning profile and I'm unable to install (install loop) the IPA on a device.
device is registered in the provisioning profile
profile is on the device
profile is valid
profile is listed un Xcode
cert is in my keychain, all green
I'm using Hudson to build the IPA and it all worked fine until I had to updated the cert and the profile.
Console log I'm getting when installing:
Jan 10 12:12:52 Martins-iPhone SpringBoard[1790] : Killing com.wci.turntape for app installation
Jan 10 12:12:52 Martins-iPhone itunesstored[1788] : LaunchServices: installing app for existing placeholder LSApplicationProxy: com.wci.turntape (Placeholder)
Jan 10 12:12:52 Martins-iPhone itunesstored[1788] : LaunchServices: Creating installProgressForApplication:LSApplicationProxy: com.wci.turntape (Placeholder) withPhase:1
Jan 10 12:12:52 Martins-iPhone lsd[1787] : LaunchServices: Updating installPhase for parent to 1
Jan 10 12:12:52 Martins-iPhone installd[62] : 0x303000 handle_install_for_ls: Install of "/var/mobile/Media/Downloads/-3941318386609200153/2973774017215790161" requested by itunesstored
Jan 10 12:12:55 Martins-iPhone installd[62] : 0x303000 MobileInstallationInstall_Server: Installing app com.wci.turntape
Jan 10 12:12:56 Martins-iPhone installd[62] : developer cert trust result = 5
Jan 10 12:12:56 Martins-iPhone installd[62] : 0x303000 verify_signer_identity: MISValidateSignatureAndCopyInfo failed for /var/tmp/install_staging.p38MaR/foo_extracted/Payload/Turntape.app/turntape: 0xe8008018
Jan 10 12:12:56 Martins-iPhone installd[62] : 0x303000 do_preflight_verification: Could not verify executable at /var/tmp/install_staging.p38MaR/foo_extracted/Payload/Turntape.app
Jan 10 12:12:56 Martins-iPhone installd[62] : 0x303000 install_application: Could not preflight application install
Jan 10 12:12:56 Martins-iPhone itunesstored[1788] : 0x1e60000 MobileInstallationInstallForLaunchServices: failed with -1
Jan 10 12:12:56 Martins-iPhone itunesstored[1788] : ERROR: MobileInstallationInstallForLaunchServices returned nil
Jan 10 12:12:56 Martins-iPhone lsd[1787] : LaunchServices: installation failed for app com.wci.turntape
Does anything in the log ring a bell to anyone?
But all my
I found this guy with the same issue
http://community.phonegap.com/nitobi/topics/error_on_installation-p3psw
But his solution was to renew his expired certificate (which is what I did in the first place).
After spilling a lot of blood, I've found what was causing the problem...
The new certificates now have an organizational unit id (mine was YXW8YWB9K4) has a suffix to the certificate. Hudson was configured to look for the certificate without this suffix.
The problem was that we also had an Enterprise certificate and the build was getting messed up between the two certificates. With the previous certificate, there was no ambiguity because there was no suffix.
So I had to add the suffix my build parameter .
Example:
"iPhone Distribution: Company Inc"
And my certificates were:
"iPhone Distribution: Company Inc (YXW8YWB9K4)"
"iPhone Distribution: Company Inc (Ent)"
Btw for those having an Enterprise account, Apple's advice is to have a separate keychain for those certificates.
Please check once again that the IPA you are distributing is being signed with the correct profile. Make sure your new certificates are having the bundle identifier for the matching profile.

Xcode 4.5 - can't install developer .ipa files via iTunes

I had many times making a developer builds for testing purpose and everything was working fine. Was! After updating my Xcode to version 4.5 I can't install my developer builds via iTunes.
This situation is the same on every device I had in provision profile.
What I have and what I had checked double times with other developers to avoid personal mistake:
1) developer certificate
2) developer provision profile with added right devices
3) right build process
After success build of app me and other developers try to install it via iTunnes (10.7) but only error dialog appears that Synchronisation failed.
The very important info is, that I can build runnable app in xCode 4.2 and install it via iTunnes without any troubles with the same certificate and provision profiles
I can run the app directly on device if I run it via Xcode
Checked all apple's recommendation and I have all right: https://developer.apple.com/library/ios/#technotes/tn2009/tn2242.html
Checked lots of forums with similar issue and I have done many steps trying to reduce this problem starting with revoking ALL certificates, making new developers profiles with particular devices, cleaned tmp folders in Xcode together with build dir. I had delete all certificates, keys from KeyChain and import new ones. Deleted all provision profiles on device and install new one. Clean project, change a build architecture "armv", base SDK - Latest iOS 6.
Many thanks for your responce!!!
This is a part of log file from device (iPhone5 iOS 6.1)
Nov 7 23:31:04 lockdownd[29] <Notice>: 016ca000 __copy_itunes_value_block_invoke_0: com.apple.mobile.iTunes.store/PurchaseTypes -> (null)
Nov 7 23:31:09 installd[31] <Error>: 0x343000 handle_install: Install of "/var/mobile/Media/PublicStaging/denik4.ipa" requested by itunesstored
Nov 7 23:31:09 installd[31] <Error>: 0x343000 MobileInstallationInstall_Server: Installing app cz.newslab.denik
>
Nov 7 23:31:09 installd[31] <Error>: profile not valid: 0xe8008012
>
Nov 7 23:31:09 installd[31] <Error>: 0x343000 install_embedded_profile: Could not install embedded profile: 0xe8008012
>
Nov 7 23:31:09 installd[31] <Error>: Nov 7 23:31:09 SecTrustEvaluate [leaf CriticalExtensions IssuerCommonName]
>
Nov 7 23:31:09 mobile_assertion_agent[94] <Notice>: service_one_connection: Connection closed for client iTunes.
>
Nov 7 23:31:10 installd[31] <Error>: entitlement 'keychain-access-groups' has value not permitted by a provisioning profile
>
Nov 7 23:31:10 installd[31] <Error>: entitlement 'aps-environment' has value not permitted by a provisioning profile
>
Nov 7 23:31:10 installd[31] <Error>: entitlement 'application-identifier' has value not permitted by a provisioning profile
>
Nov 7 23:31:10 installd[31] <Error>: 0x343000 verify_signer_identity: MISValidateSignatureAndCopyInfo failed for /var/tmp/install_staging.yDZPNm/foo_extracted/Payload/denik.app/denik: 0xe8008016
>
Nov 7 23:31:10 installd[31] <Error>: 0x343000 do_preflight_verification: Could not verify executable at /var/tmp/install_staging.yDZPNm/foo_extracted/Payload/denik.app
>
Nov 7 23:31:10 installd[31] <Error>: 0x343000 install_application: Could not preflight application install
>
Nov 7 23:31:10 itunesstored[66] <Error>: 0x1786000 MobileInstallationInstall: failed with -1
>
Nov 7 23:31:10 installd[31] <Error>: 0x343000 handle_install: API failed
The important line is this one:
installd[31] : profile not valid: 0xe8008012
I've seen this error myself with one of our IPAs recently. It was solved by re-issuing the profile from the iOS Provisioning portal (simply make a simple change, undo it, then submit - that should regenerate the profile), updated the Xcode code signing identity to use the new profile, rebooted the device, and then tried again. It then seemed to install fine.
We weren't able to close in on a root cause of the issue, but once we'd gone through those steps we haven't seen it again.

App crashing immediately after start

EDIT: My problem was because the plist file was corrupted . So if you have the same issue, probably is because of something in you plist file.
SO i have this app and everything worked just fine until i updated my device to IOS 6. After that i couldn't install the app on the device . The app worked just fine on IOS 5.0 simulator and IOS 6.0 simulator . When i try to build it for device , the splash screen appears for two second and then the app closes . In Xcode i receive this error :
timed out waiting for app to launch
I searched the web and it said that it is a AdHoc provisioning problem but my provisioning profiles are in order . I even changed the app id and deleted the old provisioning and i got the same error .
In the device console i receive this weird error :
Oct 15 23:48:23 iPad2-3G backboardd[51] <Warning>: Launch Services: Registered unknown app identifier InvoiceAppDev
��Oct 15 23:48:23 iPad2-3G backboardd[51] <Warning>: Launch Services: Unable to find app identifier InvoiceAppDev
Oct 15 23:48:23 iPad2-3G backboardd[51] <Warning>: Can't create application "InvoiceAppDev" without a bundle path
Oct 15 23:48:44 iPad2-3G mobile_house_arrest[200] <Error>: Max open files: 78
��Oct 15 23:48:44 iPad2-3G installd[30] <Error>: 0x2ff81000 handle_install: Install of "/var/mobile/Media/PublicStaging/InvoiceApp.app" requested by mobile_installation_proxy
Oct 15 23:48:44 iPad2-3G installd[30] <Error>: 0x2ff81000 MobileInstallationInstall_Server: Installing app InvoiceAppDev
��Oct 15 23:48:44 iPad2-3G installd[30] <Error>: Oct 15 23:48:44 SecTrustEvaluate [leaf CriticalExtensions IssuerCommonName]
Oct 15 23:48:45 iPad2-3G installd[30] <Error>: entitlement 'application-identifier' has value not permitted by a provisioning profile
��Oct 15 23:48:45 iPad2-3G installd[30] <Error>: entitlement 'com.apple.developer.ubiquity-container-identifiers' has value not permitted by a provisioning profile
I don't have any clue what happened . Does anybody has any idea why this happened ?
I saw the same error caused by the accidental entry of the following blank field in app.plist:
+ <key>LSApplicationCategoryType</key>
+ <string></string>
I had the exact same symptoms. Believe it or not, I changed my target code signing from distribution to developer and everything worked as expected.
Thanks #nycynik - that solved the problem.
In xcode open the the "Organizer", choose the device (ex. iPhone), select "Application" and delete the previous Version of the
App. Than run again.

Resources