我的应用程序在模拟器中运行良好,但当我尝试在我的iPhone上安装它时它说
App installation failed: An unknown error has occurred.
我打开了设备日志,得到了这个:
Nov 12 21:17:19 Isaacs-iPhone streaming_zip_conduit[5853] : LaunchServices: installing app for existing placeholder Raritea.FSS-App <(null) Not found in database>
Nov 12 21:17:19 Isaacs-iPhone streaming_zip_conduit[5853] : LaunchServices: Not creating progress for Raritea.FSS-App <(null) Not found in database> since it is not a placeholder.
Nov 12 21:17:19 Isaacs-iPhone installd[4549] : 0x16e1bb000 -[MIClientConnection installPath:withOptions:completion:]: Install of “/var/mobile/Media/PublicStaging/FSS App.app” type Developer (LSInstallType = (null)) requested by streaming_zip_conduit (pid 5853)
Nov 12 21:17:19 Isaacs-iPhone installd[4549] : 0x16e12f000 -[MIInstaller performInstallationWithError:]: Installing
Nov 12 21:17:20 Isaacs-iPhone profiled[4644] : (Note ) MC: Provisioning profiles changed
Nov 12 21:17:20 Isaacs-iPhone profiled[4644] : (Note ) MC: Updating MIS trust…
Nov 12 21:17:20 Isaacs-iPhone securityd[4588] : secTaskDiagnoseEntitlements MISSING keychain entitlements: no stored taskRef found
Nov 12 21:17:20 Isaacs-iPhone securityd[4588] : secTaskDiagnoseEntitlements MISSING keychain entitlements: no stored taskRef found
Nov 12 21:17:20 Isaacs-iPhone installd[4549] : SecTrustEvaluate [leaf IssuerCommonName SubjectCommonName]
Nov 12 21:17:20 Isaacs-iPhone profiled[4644] : (Note ) MC: Provisioning profiles changed
Nov 12 21:17:20 Isaacs-iPhone profiled[4644] : (Note ) MC: Updating MIS trust…
Nov 12 21:17:20 Isaacs-iPhone installd[4549] : unrecognized status -67049 from codesigning library
Nov 12 21:17:20 Isaacs-iPhone installd[4549] : 0x16e12f000 +[MICodeSigningVerifier _validateSignatureAndCopyInfoForURL:withOptions:error:]: 142: Failed to verify code signature of /private/var/mobile/Library/Caches/com.apple.mobile.installd.staging/temp.FvOJz0/extracted/FSS App.app/PlugIns/QuickSched.appex : 0xe8008001 (An unknown error has occurred.)
Nov 12 21:17:20 Isaacs-iPhone installd[4549] : 0x16e12f000 -[MIInstaller performInstallationWithError:]: Verification stage failed
Nov 12 21:17:20 Isaacs-iPhone streaming_zip_conduit[5853] : 0x16e087000 __MobileInstallationInstallForLaunchServices_block_invoke222: Returned error Error Domain=MIInstallerErrorDomain Code=13 “Failed to verify code signature of /private/var/mobile/Library/Caches/com.apple.mobile.installd.staging/temp.FvOJz0/extracted/FSS App.app/PlugIns/QuickSched.appex : 0xe8008001 (An unknown error has occurred.)” UserInfo={LibMISErrorNumber=-402620415,LegacyErrorString=ApplicationVerificationFailed,SourceFileLine=142,FunctionName=+[MICodeSigningVerifier _validateSignatureAndCopyInfoForURL:withOptions:error:],NSLocalizedDescription=Failed to verify code signature of /private/var/mobile/Library/Caches/com.apple.mobile.installd.staging/temp.FvOJz0/extracted/FSS App.app/PlugIns/QuickSched.appex : 0xe8008001 (An unknown error has occurred.)}
Nov 12 21:17:20 Isaacs-iPhone streaming_zip_conduit[5853] : ERROR: MobileInstallationInstallForLaunchServices returned nil
Nov 12 21:17:20 Isaacs-iPhone streaming_zip_conduit[5853] : __dispatch_source_read_socket_block_invoke:274: Failed to install application at file:///var/mobile/Media/PublicStaging/FSS%20App.app/ : Error Domain=LaunchServicesError Code=0 “(null)” UserInfo={Error=ApplicationVerificationFailed,ErrorDetail=-402620415,ErrorDescription=Failed to verify code signature of /private/var/mobile/Library/Caches/com.apple.mobile.installd.staging/temp.FvOJz0/extracted/FSS App.app/PlugIns/QuickSched.appex : 0xe8008001 (An unknown error has occurred.)}
设备日志中的这一行对我来说很突出,希望你也看到它:
Failed to verify code signature of /private/var/mobile/Library/Caches/com.apple.mobile.installd.staging/temp.FvOJz0/extracted/FSS App.app/PlugIns/QuickSched.appex
这就是说(尽管Xcode认为在构建时一切正常),您的设备拒绝了应用扩展程序的代码签名.
有一些解决方案here,但根据我的个人经验,此问题只能通过修改您的应用和应用扩展程序的代码签名设置来解决.确保使用相同的证书对应用和应用扩展程序进行签名(尽管可能有不同的配置文件).
正如其他人所推荐的那样,我也能够通过在Xcode中为项目运行Clean操作来解决这个问题,也可以通过deleting the derived data directories来解决这个问题.但我并不总是这样做.