Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
927 views
in Technique[技术] by (71.8m points)

ios - Xcode can't install application

I'm running Xcode 11.2.1 and all of a sudden started getting the error Unable to install "my app name". The app builds fine and I was able to install it to the same phone not 20 minutes ago and I haven't made any code changes since then.

Here's a screenshot of the error:

enter image description here

So far I have tried uninstalling the existing app on the phone, restarting the phone, restarting xcode, restarting the computer, clearing derived data, disconnecting and reconnecting the phone many times. Nothing has worked, still getting the same error.

Xcode provides no additional errors other than the one shown.

Has anyone else faced something similar / knows a potential fix?


Update: Okay so xcode does provide some insight, If I click the details button shown in the screenshot I can see the following info:

App installation failed
Domain: com.apple.dtdevicekit
Code: -402620388
Failure Reason: No code signature found.
User Info: {
    DVTRadarComponentKey = 487927;
    "com.apple.dtdevicekit.stacktrace" = (
    0   DTDeviceKitBase                     0x000000011d62f6e7 DTDKCreateNSError + 109
    1   DTDeviceKitBase                     0x000000011d62fde9 DTDK_AMDErrorToNSError + 792
    2   DTDeviceKitBase                     0x000000011d66f56a __90-[DTDKMobileDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:]_block_invoke + 164
    3   DVTFoundation                       0x0000000103ccd156 DVTInvokeWithStrongOwnership + 73
    4   DTDeviceKitBase                     0x000000011d66f301 -[DTDKMobileDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:] + 1589
    5   IDEiOSSupportCore                   0x000000011d4f7a25 __118-[DVTiOSDevice(DVTiPhoneApplicationInstallation) processAppInstallSet:appUninstallSet:installOptions:completionBlock:]_block_invoke.352 + 4523
    6   DVTFoundation                       0x0000000103dfe3ba __DVT_CALLING_CLIENT_BLOCK__ + 7
    7   DVTFoundation                       0x0000000103dffa92 __DVTDispatchAsync_block_invoke + 809
    8   libdispatch.dylib                   0x00007fff665c4553 _dispatch_call_block_and_release + 12
    9   libdispatch.dylib                   0x00007fff665c54de _dispatch_client_callout + 8
    10  libdispatch.dylib                   0x00007fff665caa9e _dispatch_lane_serial_drain + 597
    11  libdispatch.dylib                   0x00007fff665cb422 _dispatch_lane_invoke + 363
    12  libdispatch.dylib                   0x00007fff665d4aa1 _dispatch_workloop_worker_thread + 598
    13  libsystem_pthread.dylib             0x00007fff6681e763 _pthread_wqthread + 290
    14  libsystem_pthread.dylib             0x00007fff6681e5c3 start_wqthread + 15
);
}

Seems to be a code signing issue, though I don't know why my code signature would've changed...

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Okay, so after trying to run to a simulator, Xcode gave me a build time error stating that one of the frameworks I was using wasn't built for the correct architecture... This is because the framework was built for phone architecture not simulator. So I rebuilt the framework, this time for phone and for simulator, and voila it built and installed to the simulator no problem!

I then tried to run it to the phone again and it installed without issue!

So I guess somehow the signature on that framework or something must've been invalid, and rebuilding it fixed the issue.

Not sure if this will help anyone else but I'll leave the answer here just in case.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...