16

Just updated an iPad Mini to iOS 8 and suddenly can't debug my app on it with XCode 6.0.1. The error in Xcode is App installation failed with An unknown error has occurred.. On the device the app remains greyed out.

Tried to :

  • delete the app from ipad ( was working before )
  • Soft reset and reboot the device
  • Delete derived data and clean
  • Reboot the mac
  • reinstall xcode
  • change the bundle id and product name
  • Recreate the dev certificates and provisioning profiles

With iOS 6 and iOS 7 devices works fine, also, can debug other projects too, but not this one, so I'm getting desperate.

Any idea ?

Console log:

23/09/14 18:24:16,617 Xcode[421]: createShadowPath (thread 0x12a2f6000): returning: /var/folders/lq/1z47wljj77gbhhrhc9z_yylw0000gn/C/com.apple.DeveloperTools/6.0.1/Xcode/942f46185227b6e098ea41a4548a0649/e269ac837383a4b805c1e212d18ffe36483ab24a/TDev.app
23/09/14 18:24:16,617 Xcode[421]: createSiblingInPath (thread 0x12a2f6000): returning: /var/folders/lq/1z47wljj77gbhhrhc9z_yylw0000gn/C/com.apple.DeveloperTools/6.0.1/Xcode/942f46185227b6e098ea41a4548a0649/e269ac837383a4b805c1e212d18ffe36483ab24a/ManifestCache.plist
23/09/14 18:24:16,690 Xcode[421]: _AMDeviceCopyInstalledAppInfo (thread 0x12a2f6000): no app info
23/09/14 18:24:16,693 Xcode[421]: AMDeviceSecureInstallApplicationBundle (thread 0x12a2f6000): unable to get installed app info, falling back to old skool install
23/09/14 18:24:16,693 Xcode[421]: AMDeviceSecureInstallApplicationBundle (thread 0x12a2f6000): Blasting the bundle over to the device in an old skool way
23/09/14 18:24:27,005 Xcode[421]: AMDErrorForMobileInstallationCallbackDict (thread 0x114564000): GOT AN ERROR 0xe800003a
23/09/14 18:24:27,032 Xcode[421]: SZConduit: _MonitorResultDispatchFunction:140 (0x0x114564000): Got error from service: InstallationFailed
23/09/14 18:24:27,033 Xcode[421]: _AMDeviceTransferAndInstall (thread 0x12a2f6000): SZConduitSendPathWithPreflight failed: 0xe8008001
23/09/14 18:24:27,051 Xcode[421]: writeDictToFile:1258 ==== Successfully wrote Manifest cache to /var/folders/lq/1z47wljj77gbhhrhc9z_yylw0000gn/C/com.apple.DeveloperTools/6.0.1/Xcode/942f46185227b6e098ea41a4548a0649/e269ac837383a4b805c1e212d18ffe36483ab24a/ManifestCache.plist
23/09/14 18:24:27,053 Xcode[421]: AMDeviceSecureInstallApplicationBundle (thread 0x12a2f6000): returning 0xe8008001

Edit:

It seems that the regeneration of the certificates was the solution but after Clean there was necessary a Clean Build Folder too, which solved the issue (for now at least).

Templar
  • 1,694
  • 1
  • 14
  • 32
  • 1
    "unable to get installed app info, falling back to old skool install". No idea what this means, but its a lead. (ahh apple) – ne1410s Sep 23 '14 at 15:53
  • If you go Xcode > Window > Devices > Your Device what does it say? – Razvan Sep 23 '14 at 15:54
  • @codeFi What do you mean exactly ? it shows the device, model, ios 8.0. – Templar Sep 23 '14 at 16:08
  • @Templar Never-mind my last question because Xcode 6 doesn't have an "Use for development" button anymore. Is your device added in your Developer Portal, Devices tab? If not, add it and generate a new provisioning profile for your app (either development or distribution for ad hoc testing). – Razvan Sep 23 '14 at 16:10
  • @codeFi Yes it is, i'm using it almost daily for debug and adhoc testing ( through old non-apple testflight ). – Templar Sep 23 '14 at 16:13

11 Answers11

14

Just to add (and thanks to everyone for the hints given here) that systematically finding out the cause of this was key for me resolving this.

Using the “Devices” Window in Xcode6 to then connect to the plugged in iPhone allows you to view the live log - once you have selected the iPhone click on the tiny up-arrow icon at the bottom. In my case the output was as shown below, strongly indicating that “Failed to verify code signature…” of one of my (custom) bundled frameworks was at the crux of the problem.

This lead me to check and find out it was nothing to do with out of date certificates (everything was in date) nor any left-over DerivedData or temp build files (although always good to do a clean!)

It was the fact that my custom framework’s “CFBundleExecutable” had a typo - so signing was actually throwing an error. This is not immediately reported in Xcode - even if the tick box is on for your embedded frameworks to "Code sign on copy". Try signing a framework separately on the command line and it will tell you!

Jul 13 09:40:43 Tims-iPhone installd[2302] <Notice>: 0x10048c000 -[MIClientConnection _doBackgroundInstallationForPath:withOptions:completion:]: Install of "/var/mobile/Media/PublicStaging/miin.app" type Developer requested by streaming_zip_conduit (pid 2303)
Jul 13 09:40:43 Tims-iPhone installd[2302] <Notice>: 0x10048c000 -[MIInstaller performInstallationWithError:]: Installing <MIInstallableBundle ID=com.timlukins.miin; Version=1, ShortVersion=1.0>
Jul 13 09:40:44 Tims-iPhone profiled[2107] <Notice>: (Note ) MC: Provisioning profiles changed
Jul 13 09:40:44 Tims-iPhone installd[2302] <Error>:  SecTrustEvaluate  [leaf CriticalExtensions IssuerCommonName]
Jul 13 09:40:44 Tims-iPhone installd[2302] <Error>:  SecTrustEvaluate  [leaf CriticalExtensions IssuerCommonName]
Jul 13 09:40:44 Tims-iPhone installd[2302] <Error>: unrecognized status -67049 from codesigning library
Jul 13 09:40:44 Tims-iPhone installd[2302] <Error>: 0x10048c000 -[MICodeSigningVerifier performValidationWithError:]: 188: Failed to verify code signature of <MIExecutableBundle : path = /private/var/mobile/Library/Caches/com.apple.mobile.installd.staging/temp.J7tWkl/extracted/miin.app/Frameworks/libmiincore.framework identifier = com.timlukins.libmiincore type = Framework> : 0xe8008001 (Unknown error)
Jul 13 09:40:44 Tims-iPhone installd[2302] <Error>: 0x10048c000 -[MIInstaller performInstallationWithError:]: Verification stage failed
Jul 13 09:40:44 Tims-iPhone streaming_zip_conduit[2303] <Error>: 0x100484000 __MobileInstallationInstallForLaunchServices_block_invoke240: Returned error Error Domain=MIInstallerErrorDomain Code=13 "Failed to verify code signature of <MIExecutableBundle : path = /private/var/mobile/Library/Caches/com.apple.mobile.installd.staging/temp.J7tWkl/extracted/miin.app/Frameworks/libmiincore.framework identifier = com.timlukins.libmiincore type = Framework> : 0xe8008001 (Unknown error)" UserInfo=0x12ee1fa30 {LibMISErrorNumber=-402620415, LegacyErrorString=ApplicationVerificationFailed, SourceFileLine=188, FunctionName=-[MICodeSigningVerifier performValidationWithError:], NSLocalizedDescription=Failed to verify code signature of <MIExecutableBundle : path = /private/var/mobile/Library/Caches/com.apple.mobile.installd.staging/temp.J7tWkl/extracted/miin.app/Frameworks/libmiincore.framework identifier = com.timlukins.libmiincore type = Framework> : 0xe8008001 (Unknown error)}
Jul 13 09:40:44 Tims-iPhone streaming_zip_conduit[2303] <Warning>: ERROR: MobileInstallationInstallForLaunchServices returned nil
Jul 13 09:40:44 Tims-iPhone streaming_zip_conduit[2303] <Warning>: __dispatch_source_read_socket_block_invoke:203: Failed to install application at file:///var/mobile/Media/PublicStaging/miin.app/ : Error Domain=LaunchServicesError Code=0 "The operation couldn’t be completed. (LaunchServicesError error 0.)" UserInfo=0x12ed20140 {Error=ApplicationVerificationFailed, ErrorDetail=-402620415, ErrorDescription=Failed to verify code signature of <MIExecutableBundle : path = /private/var/mobile/Library/Caches/com.apple.mobile.installd.staging/temp.J7tWkl/extracted/miin.app/Frameworks/libmiincore.framework identifier = com.timlukins.libmiincore type = Framework> : 0xe8008001 (Unknown error)}
Community
  • 1
  • 1
timlukins
  • 2,694
  • 21
  • 35
  • 1
    Brilliant! Being able to see the exact cause is much more useful than the generic "An unknown error occurred". – TMc Jul 14 '15 at 03:49
  • This is really useful. Rather than wandering around in the dark, finding out the exact reason is the best way to go. I was able to find the exact third-party library causing the issue using this method. – Isuru Dec 08 '16 at 11:57
8

I just got hit by this with Xcode 7.2. Looking at the device console log pointed to a 3rd party framework in CocoaPods. Did a "pod update" and all is good now.

EPage_Ed
  • 1,173
  • 11
  • 11
7

My experience to get a fix for what it's worth... Xcode 7.3

I had a very annoying pod that was no longer in use so made sure it was removed from frameworks. Next - CocoaPods complained about the Frameworks in use - so made sure I was running the latest Ruby I have (2.1.2 in my case), then did the following:

  1. Updated pods
  2. 'Product'-> 'Clean'
  3. Opt 'Product'-> 'Clean'
  4. Deleted all derived data

Solution worked - One thing I noticed though - when I tried this first I got a permissions error when trying the Opt 'Product'-> 'Clean'. Hence the 'delete "all" derived data, rather than just the projects...

No idea why it worked, but thought I'd share in case it helps someone.

Stewart
  • 125
  • 3
  • 12
4

Do you use any external library or SDK? Maybe you have a library that isn't supporting iOS 8.

If I were you, I'd create a new project, just for testing purposes, with a single view and check if it runs in iOS 8 with my Xcode in my computer. If it runs ok, then the problem is just in your actual project.

Leandro Fournier
  • 927
  • 1
  • 9
  • 21
  • I use lots of them through CocoaPods. Other small test projects with 1-2 libraries are installing fine. Since I didn't get any error about missing files or wrong architectures, didn't really thought of this option. Will give it a try tomorrow. – Templar Sep 23 '14 at 16:38
  • 2
    Templar, did you get this resolved? If so, can you share your solution? Thanks...and happy coding! – TheTwoNotes Oct 14 '14 at 12:18
  • upvote for 2nd para. solution can be different for different situation. But its not general solution. – Nico Nov 23 '16 at 09:36
1

I had the same issue and it was related to the provisioning process. My project was connected to two developer accounts and on one of them had expired certificates.

To solve the issue I had to remove one of the accounts and chose the specific 'Signing Identity' in 'Build Settings'. I don't know if it's a requirement but during this process I deleted the projects 'Derived Data'.

ABeanSits
  • 1,725
  • 1
  • 17
  • 34
1

I wasted over 3 days, now I resolve same issue. In my case, my project has 3rd party frameworks (my case is Dropbox).

Probably Xcode requires signing to each embedded frameworks at "Build phases/ Copy files". Or embedded code is too old to copy to Xcode build.

  • if Xcode requires signing to each embedded framworks, what should we do? The following build commands failed: PhaseScriptExecution [CP]\ Embed\ Pods\ Frameworks ~/Library/Developer/Xcode/DerivedData/360-aubdswrybcheuibwsvuvjfhabbuc/Build/Intermediates/360.build/release-iphoneos/360.build/Script-B670D6B48FC872850F1C42CD.sh (1 failure) – biolinh Nov 15 '16 at 16:58
1

In my case the problem was I had no space left on the device. Hope that helps someone else.

dchakarov
  • 9,048
  • 3
  • 25
  • 20
1

Ill just run "pod update" again when using Cocoapods. Tested with Xcode 7.3.

derdida
  • 14,784
  • 16
  • 90
  • 139
1

In my case I just updated cocoa pods and it worked. Please update pods and check again.

Ghulam Rasool
  • 3,996
  • 2
  • 27
  • 40
0

I just removed the third party frameworks I was using. Then re-installed them. This fixed my problem. Hope this helps someone.

smottt
  • 3,272
  • 11
  • 37
  • 44
red55
  • 115
  • 1
  • 10
0

If there is anyone using the User Notification Extensions or Content in iOS 10 and then deleted the folders/files that XCode generates for you. You may get the same error: App installation failed with An unknown error has occurred

Then go to your project targets and delete the target that the Extension/Content generates. Sometimes, if you try to do that, XCode will crash. I spend about an hour trying to figure out why... eg: Cleaning build folders and derived data folders. What fixed it was to remove the UserNotification Frameworks that were linked to that Scheme. Only then, I was able to delete the said scheme.

In my case, I only needed the extension, so I deleted the target highlighted with gray.

enter image description here

Jesus Rodriguez
  • 2,571
  • 2
  • 22
  • 38