Xcode 无法安装应用程序 [英] Xcode can't install application

查看:52
本文介绍了Xcode 无法安装应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行 Xcode 11.2.1,突然开始出现错误无法安装我的应用程序名称".该应用程序构建良好,我能够在 20 分钟前将其安装到同一部手机上,从那时起我没有进行任何代码更改.

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.

错误截图如下:

到目前为止我已经尝试卸载手机上现有的应用程序,重新启动手机,重新启动xcode,重新启动计算机,清除派生数据,断开和重新连接手机多次.没有任何效果,仍然出现相同的错误.

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 没有提供除了显示的错误之外的其他错误.

Xcode provides no additional errors other than the one shown.

有没有其他人遇到过类似的事情/知道潜在的解决方法?

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

更新:好的,所以 xcode 确实提供了一些见解,如果我单击屏幕截图中显示的详细信息按钮,我可以看到以下信息:

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...

推荐答案

好的,所以在尝试运行到模拟器后,Xcode 给了我一个构建时错误,指出我使用的框架之一不是为正确的架构...这是因为该框架是为手机架构而非模拟器而构建的.所以我重新构建了框架,这次是为手机和模拟器,瞧,它构建并安装到模拟器没问题!

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.

这篇关于Xcode 无法安装应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆