如何在Xcode中为集成Firebase的iOS Swift应用正确完成代码签名
问题描述
- 技术栈:使用Swift/SwiftUI开发iOS应用,选用Firebase作为后端服务
- 正常运行场景:应用可在本地iOS模拟器正常运行;无任何第三方依赖的基础Swift/SwiftUI项目,使用已付费的Apple Developer账号开启自动代码签名后,可正常部署到真机
- 异常复现路径:在基础项目代码中集成Firebase、在入口文件添加Firebase配置初始化逻辑后,再次尝试将应用安装到真机时触发报错,该问题在Xcode 13、Xcode 14版本中均存在,初步判断与Firebase集成有关
- 核心错误提示:The code signature version is no longer supported,对应错误码
-402620375
完整错误日志
Domain: com.apple.dt.MobileDeviceErrorDomain Code: -402620375 User Info: { DVTErrorCreationDateKey = "2022-06-09 20:25:58 +0000"; IDERunOperationFailingWorker = IDEInstalliPhoneLauncher; } -- The code signature version is no longer supported. Domain: com.apple.dt.MobileDeviceErrorDomain Code: -402620375 User Info: { DVTRadarComponentKey = 261622; MobileDeviceErrorCode = "(0xE8008029)"; "com.apple.dtdevicekit.stacktrace" = ( 0 DTDeviceKitBase 0x00000001121282f0 DTDKCreateNSErrorFromAMDErrorCode + 264 1 DTDeviceKitBase 0x000000011215c3f8 __90-[DTDKMobileDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:]_block_invoke + 136 2 DVTFoundation 0x0000000107165ab8 DVTInvokeWithStrongOwnership + 76 3 DTDeviceKitBase 0x000000011215c17c -[DTDKMobileDeviceToken installApplicationBundleAtPath:withOptions:andError:withCallback:] + 1196 4 IDEiOSSupportCore 0x000000011392184c __118-[DVTiOSDevice(DVTiPhoneApplicationInstallation) processAppInstallSet:appUninstallSet:installOptions:completionBlock:]_block_invoke.147 + 2328 5 DVTFoundation 0x0000000107272968 __DVT_CALLING_CLIENT_BLOCK__ + 16 6 DVTFoundation 0x00000001072733d4 __DVTDispatchAsync_block_invoke + 152 7 libdispatch.dylib 0x00000001bbbca5f0 _dispatch_call_block_and_release + 32 8 libdispatch.dylib 0x00000001bbbcc1b4 _dispatch_client_callout + 20 9 libdispatch.dylib 0x00000001bbbd38a8 _dispatch_lane_serial_drain + 668 10 libdispatch.dylib 0x00000001bbbd4404 _dispatch_lane_invoke + 392 11 libdispatch.dylib 0x00000001bbbdec98 _dispatch_workloop_worker_thread + 648 12 libsystem_pthread.dylib 0x00000001bbd8c360 _pthread_wqthread + 288 13 libsystem_pthread.dylib 0x00000001bbd8b080 start_wqthread + 8 ); } -- Analytics Event: com.apple.dt.IDERunOperationWorkerFinished : { "device_model" = "iPhone13,1"; "device_osBuild" = "15.5 (19F77)"; "device_platform" = "com.apple.platform.iphoneos"; "launchSession_schemeCommand" = Run; "launchSession_state" = 1; "launchSession_targetArch" = arm64; "operation_duration_ms" = 8228; "operation_errorCode" = "-402620375"; "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_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" = 0; "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.4 (Build 21F79) Xcode 14.0 (21257.0.0.0.22) (Build 14A5228q) Timestamp: 2022-06-09T15:25:58-05:00
环境参数汇总
- 测试真机型号标识:iPhone13,1
- 真机系统版本:iOS 15.5 (19F77)
- 构建目标架构:arm64
- 构建使用SDK:iOS 16.0
- 开发设备系统:macOS 12.4 (21F79)
- 开发工具版本:Xcode 14.0 (14A5228q),同一问题在Xcode 13版本中可稳定复现
内容的提问来源于stack exchange,提问作者Mike P
相关产品推荐
相关产品推荐

