Xcode 11 install to device fails, code -402620415

After the upgrade to Xcode 11, an existing app that once was debuggable on device can no longer be installed and debugged on device. It is failing with an unknown error. Same failure occurs on Xcode 11.2.1 and Xcode 11.3 beta. App debugging on SImulator works fine.


This is not reporting a codesign or provisioning failure (I've seen those in the past). I'm hoping someone can help narrow down the culprits.


Details


Unable to install "NameOfMyApp"

Domain: com.apple.dtdevicekit

Code: -402620415

--

App installation failed

Domain: com.apple.dtdevicekit

Code: -402620415

Failure Reason: An unknown error has occurred.

User Info: {

DVTRadarComponentKey = 487927;

"com.apple.dtdevicekit.stacktrace" = (

0 DTDeviceKitBase 0x000000012692a6e7 DTDKCreateNSError + 109

1 DTDeviceKitBase 0x000000012692ade9 DTDK_AMDErrorToNSError + 792

2 DTDeviceKitBase 0x000000012696a56a __90-[DTDKMobileDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:]_block_invoke + 164

3 DVTFoundation 0x000000010b4ea156 DVTInvokeWithStrongOwnership + 73

4 DTDeviceKitBase 0x000000012696a301 -[DTDKMobileDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:] + 1589

5 IDEiOSSupportCore 0x00000001267f2a25 __118-[DVTiOSDevice(DVTiPhoneApplicationInstallation) processAppInstallSet:appUninstallSet:installOptions:completionBlock:]_block_invoke.352 + 4523

6 DVTFoundation 0x000000010b61b3ba __DVT_CALLING_CLIENT_BLOCK__ + 7

7 DVTFoundation 0x000000010b61ca92 __DVTDispatchAsync_block_invoke + 809

8 libdispatch.dylib 0x00007fff590635f8 _dispatch_call_block_and_release + 12

9 libdispatch.dylib 0x00007fff5906463d _dispatch_client_callout + 8

10 libdispatch.dylib 0x00007fff5906a8e0 _dispatch_lane_serial_drain + 602

11 libdispatch.dylib 0x00007fff5906b396 _dispatch_lane_invoke + 385

12 libdispatch.dylib 0x00007fff590736ed _dispatch_workloop_worker_thread + 598

13 libsystem_pthread.dylib 0x00007fff592a4611 _pthread_wqthread + 421

14 libsystem_pthread.dylib 0x00007fff592a43fd start_wqthread + 13

);

}

--

Hello guys.. I finally got the solution to this problem;

Code Block Unable to install "MyApp"Domain: com.apple.dt.MobileDeviceErrorDomainCode: -402620383--The maximum number of apps for free development profiles has been reached.Domain: com.apple.dt.MobileDeviceErrorDomain


Go to the Console app can be found in the Window >> Devices and Simulators >> click the 'Open Console' button in your phone's tab. In the Console app, type "MIFreeProfileValidatedAppTracker" in the upper right corner's search box will help you find the detail of this message after failed running your app.

I have also found that most of the bundle IDs shown in the error message are auto offload apps. Turns out the Xcode misclassified all the auto offloaded apps (apps you have not used for a while) as your free developer account's test apps. If you encounter the same problem, the solution is to re-download all the offload apps. Then, turn off the auto offload in the iPhone Settings - iTunes & App Store - Offload Unused Apps to prevent this from happening again.
DavidTatenda: Could you please file feedback through Feedback assistant and attach a sysdiagnose captured from your Mac (by running sudo sysdiagnose) and the iOS device (following the instructions at https://developer.apple.com/bug-reporting/profiles-and-logs/?name=sysdiagnose&platform=ios ) and share the feedback number here?
I have updated to macOS 10.15 and are also getting the error with MobileDeviceErrorDomain. Slightly different MobileDeviceErrorCode than others though. Happens on 2 different devices. Have deleted, cleared, etc.

Code Block DetailsUnable to install "<App>"Domain: com.apple.dt.MobileDeviceErrorDomainCode: -402653081--There was an internal API error.Domain: com.apple.dt.MobileDeviceErrorDomainCode: -402653081User Info: {    DVTRadarComponentKey = 261622;    MobileDeviceErrorCode = "(0xE8000067)";    "com.apple.dtdevicekit.stacktrace" = (	0   DTDeviceKitBase                     0x0000000119ca981a DTDKCreateNSErrorFromAMDErrorCode + 233	1   DTDeviceKitBase                     0x0000000119ceaf70 90-[DTDKMobileDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:]_block_invoke + 155	2   DVTFoundation                       0x0000000100f4ff35 DVTInvokeWithStrongOwnership + 73	3   DTDeviceKitBase                     0x0000000119ceaca8 -[DTDKMobileDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:] + 1654	4   IDEiOSSupportCore                   0x0000000119b61e91 118-[DVTiOSDevice(DVTiPhoneApplicationInstallation) processAppInstallSet:appUninstallSet:installOptions:completionBlock:]_block_invoke.352 + 4165	5   DVTFoundation                       0x00000001010835d4 DVT_CALLING_CLIENT_BLOCK + 7	6   DVTFoundation                       0x0000000101085216 __DVTDispatchAsync_block_invoke + 1194	7   libdispatch.dylib                   0x00007fff678076c4 _dispatch_call_block_and_release + 12	8   libdispatch.dylib                   0x00007fff67808658 _dispatch_client_callout + 8	9   libdispatch.dylib                   0x00007fff6780dc44 _dispatch_lane_serial_drain + 597	10  libdispatch.dylib                   0x00007fff6780e5d6 _dispatch_lane_invoke + 363	11  libdispatch.dylib                   0x00007fff67817c09 _dispatch_workloop_worker_thread + 596	12  libsystem_pthread.dylib             0x00007fff67a66a3d _pthread_wqthread + 290	13  libsystem_pthread.dylib             0x00007fff67a65b77 start_wqthread + 15);}--System InformationmacOS Version 10.15.6 (Build 19G73)Xcode 11.6 (16141)





For me, the problem had to do with bundle identifier. I had manually edited the entry in Info.plist but the entry in Signing & Capabilities showed something else.

I changed in Signing & Capabilities and Info.Plist updated to a variable $(PRODUCT_BUNDLE_IDENTIFIER). I then had to clean the build, remove any previous apps installed and rebuild.

Hope this helps someone

Has anyone fixed this error

Domain: com.apple.dt.MobileDeviceErrorDomain

Code: -402620388

Im not happy it all started when I added watch extension, now my project is broken and I can't fix, it is already published but I can't do any upgrades and it will take me a month to rebuild from scratch. Not bloody happy at all what a joke!!!!

Removing Pre-actions solved my issue.

I had the same "-402620415" - "An unknown error has occurred." error and not sure what I did, basically just opened console app for a device to check logs and it started to work. Or, maybe I had to wait some time, no clue.

To give for consideration. I had device failures because I did not have all the correct certificates granted to me by my admin. @bruno887 's answer to this following post helped resolve my issue. https://developer.apple.com/forums/thread/117098

@jsnee I'm facing the same problem, please have a look at FB10962213

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 Turvo, thank you very much for your comment! I can see the same error in Console:

Trust evaluate failure: [leaf IssuerCommonName LeafMarkerOid SubjectCommonName]
MacOS error: -67030
unrecognized status -67030 from codesigning library
0x16b7ab000 +[MICodeSigningVerifier _validateSignatureAndCopyInfoForURL:withOptions:error:]: 75: Failed to verify code signature of /var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.97uVqY/extracted/VisionBoard.app/PlugIns/IntentsExtension.appex : 0xe8008001 (An unknown error has occurred.)
0x16b7ab000 -[MIInstaller performInstallationWithError:]: Verification stage failed

The solution you proposed to modify the contents of project.pbxprojand adding CodeSignOnCopy didn't work for me. I'm still facing the above error.

However, I have found a workaround by enabling Copy only when installing in the main target of the app in the Embed App Extensions (in Build phases section). So, the extensions are not copied to the iOS device and the error is resolved as well.

My case:

Remove the same APP already installed in the iPhone. Re Build and Run. It works for me.

Xcode 11 install to device fails, code -402620415
 
 
Q