设备上的Xcode 11实时预览失败,但应用正常运行

问题描述 投票:3回答:3

我想在真实设备上预览视图,但是单击按钮时Xcode失败:

Cannot preview in this file – unexpected error occurred

单击“诊断”按钮将显示以下错误:

UVIntegration.ConcreteHardwareDevice.(unknown context at $13f0b5314).(unknown context at $13f0b531c).InstallError.failedToInstall(Error Domain=com.apple.dtdevicekit Code=-402620394 "Unable to install "AppName"" UserInfo={NSLocalizedDescription=Unable to install "AppName", NSUnderlyingError=0x7fe0360a1c50 {Error Domain=com.apple.dtdevicekit Code=-402620394 "The executable was signed with invalid entitlements." UserInfo={NSLocalizedFailureReason=The entitlements specified in your application’s Code Signing Entitlements file are invalid, not permitted, or do not match those specified in your provisioning profile. (0xE8008016)., com.apple.dtdevicekit.stacktrace=(

----------------------------------------

GenericHumanReadableError: unexpected error occurred

failedToInstall(Error Domain=com.apple.dtdevicekit Code=-402620394 "Unable to install "AppName"" UserInfo={NSLocalizedDescription=Unable to install "AppName", NSUnderlyingError=0x7fe0360a1c50 {Error Domain=com.apple.dtdevicekit Code=-402620394 "The executable was signed with invalid entitlements." UserInfo={NSLocalizedFailureReason=The entitlements specified in your application’s Code Signing Entitlements file are invalid, not permitted, or do not match those specified in your provisioning profile. (0xE8008016)., com.apple.dtdevicekit.stacktrace=(
    0   DTDeviceKitBase                     0x00000001217c66e7 DTDKCreateNSError + 109
    1   DTDeviceKitBase                     0x00000001217c6de9 DTDK_AMDErrorToNSError + 792
    2   DTDeviceKitBase                     0x000000012180656a __90-[DTDKMobileDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:]_block_invoke + 164
    3   DVTFoundation                       0x0000000106e95c12 DVTInvokeWithStrongOwnership + 73
    4   DTDeviceKitBase                     0x0000000121806301 -[DTDKMobileDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:] + 1589
    5   IDEiOSSupportCore                   0x000000012168ea25 __118-[DVTiOSDevice(DVTiPhoneApplicationInstallation) processAppInstallSet:appUninstallSet:installOptions:completionBlock:]_block_invoke.352 + 4523
    6   DVTFoundation                       0x0000000106fc6e7a __DVT_CALLING_CLIENT_BLOCK__ + 7
    7   DVTFoundation                       0x0000000106fc8552 __DVTDispatchAsync_block_invoke + 809
    8   libdispatch.dylib                   0x00007fff72809583 _dispatch_call_block_and_release + 12
    9   libdispatch.dylib                   0x00007fff7280a50e _dispatch_client_callout + 8
    10  libdispatch.dylib                   0x00007fff7280face _dispatch_lane_serial_drain + 597
    11  libdispatch.dylib                   0x00007fff72810452 _dispatch_lane_invoke + 363
    12  libdispatch.dylib                   0x00007fff72819a9e _dispatch_workloop_worker_thread + 598
    13  libsystem_pthread.dylib             0x00007fff72a6371b _pthread_wqthread + 290
    14  libsystem_pthread.dylib             0x00007fff72a6357b start_wqthread + 15
), DVTRadarComponentKey=487927, NSLocalizedDescription=The executable was signed with invalid entitlements.}}})

以上显示我的预配置设置是错误的,但是如果我单击“运行”按钮,则该应用将被部署并在我的设备上运行完全正常。

我在做什么错?

ios xcode
3个回答
0
投票
为我修复以下问题:

通过以下方式选择命令行工具:Preferences > location > commandLine tools [drop down] > select Xcode 11被选择为上一个(即Xcode 10)


0
投票
我在Xcode 11中有问题,更新到最新版本解决了我的问题

0
投票
我终于得到了这个工作!

尽管该应用程序捆绑包的所有内容都是正确的(这就是为什么该应用程序在设备上运行绝对正常的原因,但是Tests和UITests捆绑包的签名选择了错误的团队,在我更改了它们之后,我得到了错误提示,说该捆绑包我的测试包的ID无法注册到我们的团队。我更改了捆绑包ID,现在可以在设备上预览我的应用了!

© www.soinside.com 2019 - 2024. All rights reserved.