请检查您的项目设置并确保已构建有效的产品。Xcode 14

Qaz*_*mar 23 xcode ios swift swiftui

我刚刚将 Xcode 13 更新到 14 版本。更新后,我尝试在手机上构建并运行应用程序,但 Xocde 给出了此错误。任何解决这个问题的方法。我在 Apple M1 Pro 机器上使用 Mac 操作系统版本 12.6。对于模拟器,在显示消息构建成功后,Xcode 一直等待附件。

在此输入图像描述

这是详细日志。

细节

Unable to install "HTPlanner"
Domain: com.apple.dt.MobileDeviceErrorDomain
Code: -402653081
Recovery Suggestion: Please check your project settings and ensure that a valid product has been built.
User Info: {
    DVTErrorCreationDateKey = "2022-10-03 05:50:48 +0000";
    IDERunOperationFailingWorker = IDEInstalliPhoneLauncher;
}
--
There was an internal API error.
Domain: com.apple.dt.MobileDeviceErrorDomain
Code: -402653081
User Info: {
    DVTRadarComponentKey = 261622;
    MobileDeviceErrorCode = "(0xE8000067)";
    "com.apple.dtdevicekit.stacktrace" = (
    0   DTDeviceKitBase                     0x00000001147e02bc DTDKCreateNSErrorFromAMDErrorCode + 300
    1   DTDeviceKitBase                     0x00000001148143c0 __90-[DTDKMobileDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:]_block_invoke + 136
    2   DVTFoundation                       0x0000000104cfe57c DVTInvokeWithStrongOwnership + 76
    3   DTDeviceKitBase                     0x0000000114814144 -[DTDKMobileDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:] + 1196
    4   IDEiOSSupportCore                   0x00000001146dfd10 __118-[DVTiOSDevice(DVTiPhoneApplicationInstallation) processAppInstallSet:appUninstallSet:installOptions:completionBlock:]_block_invoke.147 + 2328
    5   DVTFoundation                       0x0000000104e08864 __DVT_CALLING_CLIENT_BLOCK__ + 16
    6   DVTFoundation                       0x0000000104e092d0 __DVTDispatchAsync_block_invoke + 152
    7   libdispatch.dylib                   0x00000001884a25f0 _dispatch_call_block_and_release + 32
    8   libdispatch.dylib                   0x00000001884a41b4 _dispatch_client_callout + 20
    9   libdispatch.dylib                   0x00000001884ab8a8 _dispatch_lane_serial_drain + 668
    10  libdispatch.dylib                   0x00000001884ac404 _dispatch_lane_invoke + 392
    11  libdispatch.dylib                   0x00000001884b6c98 _dispatch_workloop_worker_thread + 648
    12  libsystem_pthread.dylib             0x0000000188664360 _pthread_wqthread + 288
    13  libsystem_pthread.dylib             0x0000000188663080 start_wqthread + 8
);
}
--

Analytics Event: com.apple.dt.IDERunOperationWorkerFinished : {
    "device_model" = "iPhone14,3";
    "device_osBuild" = "16.0 (20A362)";
    "device_platform" = "com.apple.platform.iphoneos";
    "launchSession_schemeCommand" = Run;
    "launchSession_state" = 1;
    "launchSession_targetArch" = arm64;
    "operation_duration_ms" = 4572;
    "operation_errorCode" = "-402653081";
    "operation_errorDomain" = "com.apple.dt.MobileDeviceErrorDomain";
    "operation_errorWorker" = IDEInstalliPhoneLauncher;
    "operation_name" = IDEiPhoneRunOperationWorkerGroup;
    "param_consoleMode" = 0;
    "param_debugger_attachToExtensions" = 0;
    "param_debugger_attachToXPC" = 1;
    "param_debugger_type" = 5;
    "param_destination_isProxy" = 0;
    "param_destination_platform" = "com.apple.platform.iphoneos";
    "param_diag_MainThreadChecker_stopOnIssue" = 0;
    "param_diag_MallocStackLogging_enableDuringAttach" = 0;
    "param_diag_MallocStackLogging_enableForXPC" = 1;
    "param_diag_allowLocationSimulation" = 1;
    "param_diag_checker_tpc_enable" = 1;
    "param_diag_gpu_frameCapture_enable" = 0;
    "param_diag_gpu_shaderValidation_enable" = 0;
    "param_diag_gpu_validation_enable" = 0;
    "param_diag_memoryGraphOnResourceException" = 0;
    "param_diag_queueDebugging_enable" = 1;
    "param_diag_runtimeProfile_generate" = 0;
    "param_diag_sanitizer_asan_enable" = 0;
    "param_diag_sanitizer_tsan_enable" = 0;
    "param_diag_sanitizer_tsan_stopOnIssue" = 0;
    "param_diag_sanitizer_ubsan_stopOnIssue" = 0;
    "param_diag_showNonLocalizedStrings" = 0;
    "param_diag_viewDebugging_enabled" = 1;
    "param_diag_viewDebugging_insertDylibOnLaunch" = 1;
    "param_install_style" = 0;
    "param_launcher_UID" = 2;
    "param_launcher_allowDeviceSensorReplayData" = 0;
    "param_launcher_kind" = 0;
    "param_launcher_style" = 1;
    "param_launcher_substyle" = 0;
    "param_runnable_appExtensionHostRunMode" = 0;
    "param_runnable_productType" = "com.apple.product-type.application";
    "param_runnable_type" = 2;
    "param_testing_launchedForTesting" = 0;
    "param_testing_suppressSimulatorApp" = 0;
    "param_testing_usingCLI" = 0;
    "sdk_canonicalName" = "iphoneos16.0";
    "sdk_osVersion" = "16.0";
    "sdk_variant" = iphoneos;
}
--


System Information

macOS Version 12.6 (Build 21G115)
Xcode 14.0 (21335) (Build 14A309)
Timestamp: 2022-10-03T10:50:48+05:00
Run Code Online (Sandbox Code Playgroud)

Pok*_*oom 54

我也遇到了同样的问题。但我注意到我之前已经在我的设备上安装了应用程序。所以我卸载了它并从 Xcode 重新运行构建,现在它工作正常。因此,请尝试从设备上完全卸载您的应用程序,然后重新构建。


Nab*_*hir 0

有些事情你可以尝试。

首先尝试清理并重新构建项目。如果你幸运的话,这会解决一点问题,但我对此表示怀疑。

然后尝试删除Pods文件Podfile.lock并再次运行pod install

如果它不起作用(如此处所述,您可以根据您使用的模拟器在 TARGET -> Build Settings 中设置新的用户定义的构建设置。目标构建设置