47

I was trying to test my app on a new iPad to see if Retina support is working.

Like anyother devices I used for development, I attached the device and pressed "Use For Development" is XCode Organizer.

The process started but a few seconds later the progress bar went away and I received this error message : " An Unknown Error Occurred "

I registered its UDID in devices section manually and the provisioning profile is successfully installed on the device but there still is a yellow dot in front of iPad's name in organizer and the device is not appearing in the iOS Devices list ( so that I cannot run my app on it ).

I tried anything came to my mind but nothing worked out :(

enter image description here

Any ideas ?


Additional Info :

  • XCode version : 4.4.1
  • iOS SDK version : 5.1
  • Minimum Deployment Target : 5.0
  • Device iOS Version : 5.1.1 (9B206)
  • Device type : 3rd Gen New iPad ( Wifi + 4G )
  • Intel Based Mac : Mac Pro With 2 x 2.26 GHz Quad-Core Intel Xeon
  • OS Version : OS X Mountain Lion 10.8 (12A269)
DrummerB
  • 39,814
  • 12
  • 105
  • 142
Sepehrom
  • 1,335
  • 2
  • 16
  • 33

14 Answers14

135

Try disconnecting / reconnecting the iPad, quit and restart XCode, ... Sometimes it just won't work and restarting everything solves it !

nicolasthenoz
  • 1,852
  • 1
  • 13
  • 14
  • 1
    It took multiple restarts for me of both the device (iPad Pro) and Xcode. From what I can tell, the solution was update the device to the most recent version of iOS, 9.1 to 9.2.1. – Jacksonkr Jan 26 '16 at 14:01
  • 2
    Unplugging and plugging in worked for me. You think we'd be able to figure that out without Googling this problem, right? – SMKS Mar 21 '16 at 16:58
10

This has happened to me a lot when I'm plugged in via the Apple USB keyboard (that has two USB ports underneath).

If you plug in more than one thing in that keyboard, like two iPhones, it won't be able to deliver enough power to both, and you start getting intermittent disconnections.

Solution: Plug in directly to the Mac.

Can
  • 8,502
  • 48
  • 57
  • This actually happened when I connected a USB headset + my device was an iPad and perhaps it was juicing more power – mfaani Feb 20 '17 at 16:32
7

One time this happened to me and it seemed my iCloud account on my device was not logged in. This was due to a password change I had done. Once I signed back in with the proper password the app seemed to build to the device just fine. :-)

darkheartfelt
  • 1,078
  • 2
  • 12
  • 26
4

In my case, after trying everything (restart of Ipad, XCode, imac), I found out the issue was being caused by the same app still running in the background of the Ipad from a previous run. I just had to dismiss the app from Ipad and all got fixed.

Apneist
  • 396
  • 7
  • 17
  • This worked for me. I had disconnected my phone the previous day while at a breakpoint debugging. It was still running, paused at the breakpoint. Killing the app, disconnecting and reconnecting the phone fixed the problem. The clue is when you plug your phone in and it does not automatically show as the target device in xcode. – muldercnc Jan 25 '17 at 20:20
2

Not a duplicate, but OS X, XCode, and IOS often fall on their swords because of code signing and caching fails, see if anything here helps: Error : failed to launch, when running on ipad

Community
  • 1
  • 1
Taryn
  • 1,670
  • 1
  • 15
  • 22
1

I was able to fix this issue by changing the signing identity from one team to another, then back to the original team.

David Wolever
  • 148,955
  • 89
  • 346
  • 502
1

You can use xcode->windows->devices and watch the device log to get more detail about "An unknown error occurred",you will get something like this:

  • 0x16e12f000 +[MICodeSigningVerifier _validateSignatureAndCopyInfoForURL:withOptions:error:]: 142: Failed to verify code signature of /private/var/mobile/Library/Caches/com.apple.mobile.installd.staging/temp.L5Dvt0/extracted/Payload/Xxx.app/PlugIns/packetTunnel.appex : 0xe8008001 (An unknown error has occurred.)

I have seen "An unknown error occurred" at follow conditions and fix it by correcting the code:

  • I write @interface with a class,and forget @implementation with that class name in an extension target.
  • There is no code in one target of my project.
bronze man
  • 1,470
  • 2
  • 15
  • 28
0

I got this error when trying to install a 1GB app on a device with only 300MB left. I did not expect it to be an issue since the app was already installed on the device from iTunes, and I was just installing a local build to overwrite it, but I got this error repeatedly until I uninstalled the copy from the store. After that, it worked just fine.

Brian Handy
  • 361
  • 3
  • 5
0

I could only get this to work by reconnecting the phone then following through with the iCloud welcome screens on my laptop.

0

I found that because my iphone had gone flat and I had been charging it, the phone needed to be opened with the pin first to allow Xcode to connect

Damo
  • 1
  • 1
  • @manetsus I can recreate this by powering the phone down completely and then starting up and connecting to Xcode, do not enter the security pin if used yet. Try to run your project on the phone and it will fail until you enter the pin code for the first time. – Damo Jul 10 '16 at 07:53
  • I believe Damo means that the phone was locked, so he had to unlock it. – jungledev Jan 14 '17 at 01:58
0

I had same error message when i instaled new pods (CocoaPods). I was able to fix this problem by removing latest added pods from my project.

G.Swift
  • 51
  • 3
0

Happened for me when iTunes was open in the background. Closing iTunes and Xcode, then re-opening Xcode worked for me.

capikaw
  • 12,232
  • 2
  • 43
  • 46
0

I face with same trouble regularly: iPhone restart fixes it every time

Akhrameev
  • 325
  • 4
  • 12
0

I was able to identify the issue in my case. We have notification extension in the app and update bundle version after compile for builded extension .appex file and for the main .app file in the Info.plist. It looks like Xcode do not resign .appex file for some reason and so the app installation on a device fails.

From Xcode detailed info:

An unknown error has occurred.
Domain: com.apple.dt.MobileDeviceErrorDomain
Code: -402620415
User Info: {
    DVTRadarComponentKey = 280331;
    MobileDeviceErrorCode = "(0xE8008001)";
    "com.apple.dtdevicekit.stacktrace" = (
    0   DTDeviceKitBase                     0x000000011804a9d1 DTDKCreateNSErrorFromAMDErrorCode + 220
    1   DTDeviceKitBase                     0x0000000118086ce7 __90-[DTDKMobileDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:]_block_invoke + 155
    2   DVTFoundation                       0x000000010a8d47d6 DVTInvokeWithStrongOwnership + 71
    3   DTDeviceKitBase                     0x0000000118086a1d -[DTDKMobileDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:] + 1422
    4   IDEiOSSupportCore                   0x0000000117f63668 __118-[DVTiOSDevice(DVTiPhoneApplicationInstallation) processAppInstallSet:appUninstallSet:installOptions:completionBlock:]_block_invoke.301 + 3414
    5   DVTFoundation                       0x000000010aa063d4 __DVT_CALLING_CLIENT_BLOCK__ + 7
    6   DVTFoundation                       0x000000010aa074bc __DVTDispatchAsync_block_invoke + 372
    7   libdispatch.dylib                   0x00007ff80ff360cc _dispatch_call_block_and_release + 12
    8   libdispatch.dylib                   0x00007ff80ff37317 _dispatch_client_callout + 8
    9   libdispatch.dylib                   0x00007ff80ff3d317 _dispatch_lane_serial_drain + 672
    10  libdispatch.dylib                   0x00007ff80ff3ddfd _dispatch_lane_invoke + 366
    11  libdispatch.dylib                   0x00007ff80ff47eee _dispatch_workloop_worker_thread + 753
    12  libsystem_pthread.dylib             0x00007ff8100eafd0 _pthread_wqthread + 326
    13  libsystem_pthread.dylib             0x00007ff8100e9f57 start_wqthread + 15
);
}

From device console:

default 23:12:27.654813+0300    installd    0x16b2cf000 +[MICodeSigningVerifier _validateSignatureAndCopyInfoForURL:withOptions:error:]: 75: Failed to verify code signature of /var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.VTtCcC/extracted/***.app/PlugIns/***.appex : 0xe8008001 (An unknown error has occurred.)

As a workaround I manually added CodeSignOnCopy attribute to the application extension copy phase in the main app Build Phases in the project.pbxproj file since there were no checkmark for that in the Xcode:

139E0B1323ABAE7F00B66F5B /* Notification Content App Extension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 13D558D023AB9A2D00B95B48 /* Notification Content App Extension.appex */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
Anton Plebanovich
  • 1,296
  • 17
  • 17