问题描述
我有一个Xcode项目(Xcode 11.5)。它可以在模拟器中运行,并且可以在我自己的设备上正常运行,并且没有任何错误。但是当我存档时,会发生这种情况:
copySwiftLibs /Users/mabelapps/Library/Developer/Xcode/DerivedData/BeatBat3-ecrdlwcmtqtujieezcmongelfrfw/Build/Intermediates.noindex/ArchiveIntermediates/BeatBat3/InstallationBuildProductsLocation/Applications/BeatBat3项目'来自'BeatBat3.app' cd / Users / mabelapps / Library / Mobile \ Documents / com〜apple〜CloudDocs / XCode \ Projects / BeatBat3 导出CODESIGN_ALLOCATE = / Applications / Xcode.app / Contents / Developer / Toolchains / XcodeDefault.xctoolchain / usr / bin / codesign_allocate 导出DEVELOPER_DIR = / Applications / Xcode.app / Contents / Developer 导出SDKROOT = / Applications / Xcode.app / Contents / Developer / Platforms / iPhoneOS.platform / Developer / SDKs / iPhoneOS13.5.sdk Built-in-swiftStdLibTool --copy --verbose --sign 5BA046D7A018CFC33DE7C29728E7C59DB93C6959 --scan-executable / Users / mabelapps / Library / Developer / Xcode / DerivedData / BeatBat3-ecrdlwcmtqtujieezcmongelfrfw / Build / MediaBeat / ApplicationB / ApplicationBat / BeatBat / ApplicationBat / InteractiveBat / BeatBat / ApplicationBat / BeatBat / BeatBat / BeatBat / ApplicationBat / BeatBat / ApplicationBat / BeatBat .app / BeatBat3-扫描文件夹/Users/mabelapps/Library/Developer/Xcode/DerivedData/BeatBat3-ecrdlwcmtqtujieezcmongelfrfw/Build/Intermediates.noindex/ArchiveIntermediates/BeatBat3/InstallationBuildProductsLocation/Applications/BeatBat3。 /Users/mabelapps/Library/Developer/Xcode/DerivedData/BeatBat3-ecrdlwcmtqtujieezezongongrrfw/Build/Intermediates.noindex/ArchiveIntermediates/BeatBat3/InstallationBuildProductsLocation/Applications/BeatBat3.app/PlugIns --scan-folder开发人员/平台/iPhoneOS.platform/开发人员/SDKs/iPhoneOS13.5.sdk/System/Library/Frameworks/StoreKit.framework --platform iphoneos --toolchain / Applications / Xc ode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain --destination /Users/mabelapps/Library/Developer/Xcode/DerivedData/BeatBat3-ecrdlwcmtqtujieezcmongelfrfw/Build/Intermediates.noindex/ArchiveIntermediates/BeatBat3/Installation / Framework --unsigned-Destination /Users/mabelapps/Library/Developer/Xcode/DerivedData/BeatBat3-ecrdlwcmtqtujieezcmongelfrfw/Build/Intermediates.noindex/ArchiveIntermediates/BeatBat3/BuildProductsPath/SwiftSupport --emit-dependency-apps /Developer/Xcode/DerivedData/BeatBat3-ecrdlwcmtqtujieezcmongelfrfw/Build/Intermediates.noindex/ArchiveIntermediates/BeatBat3/IntermediateBuildFilesPath/BeatBat3.build/Release-iphoneos/BeatBatencies.build/SwiftStdLibToolInputDepend
将/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.0/iphoneos/libswiftCore.dylib复制到/ Users / mabelapps / Library / Developer / Xcode / DerivedData / BeatBat3- ecrdlwcmtqtujieezcmongelfrfw / Build / Intermediates.noindex / ArchiveIntermediates / BeatBat3 / InstallationBuildProductsLocation / Applications / BeatBat3.app / Frameworks / libswiftCore.dylib 将/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.0/iphoneos/libswiftFoundation.dylib复制到/ Users / mabelapps / Library / Developer / Xcode / DerivedData / BeatBat3-ecrdlwcmtqtujieezcmongelfr /Intermediates.noindex/ArchiveIntermediates/BeatBat3/InstallationBuildProductsLocation/Applications/BeatBat3.app/Frameworks/libswiftFoundation.dylib 将/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.0/iphoneos/libswiftCoreFoundation.dylib复制到/ Users / mabelapps / Library / Developer / Xcode / DerivedData / BeatBat3-ecrdlwcmtqtujieezcmongelf /Intermediates.noindex/ArchiveIntermediates/BeatBat3/InstallationBuildProductsLocation/Applications/BeatBat3.app/Frameworks/libswiftCoreFoundation.dylib 将/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.0/iphoneos/libswiftCoreGraphics.dylib复制到/ Users / mabelapps / Library / Developer / Xcode / DerivedData / BeatBat3-ecrdlwcmtqtujieezcmongelf /Intermediates.noindex/ArchiveIntermediates/BeatBat3/InstallationBuildProductsLocation/Applications/BeatBat3.app/Frameworks/libswiftCoreGraphics.dylib 将/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.0/iphoneos/libswiftObjectiveC.dylib复制到/ Users / mabelapps / Library / Developer / Xcode / DerivedData / BeatBat3-ecrdlwcmtqtujieezcmongelf /Intermediates.noindex/ArchiveIntermediates/BeatBat3/InstallationBuildProductsLocation/Applications/BeatBat3.app/Frameworks/libswiftObjectiveC.dylib 将/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.0/iphoneos/libswiftDarwin.dylib复制到/ Users / mabelapps / Library / Developer / Xcode / DerivedData / BeatBat3-ecrdlwcmtqtujieezcmongelf /Intermediates.noindex/ArchiveIntermediates/BeatBat3/InstallationBuildProductsLocation/Applications/BeatBat3.app/Frameworks/libswiftDarwin.dylib 将/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.0/iphoneos/libswiftdispatch.dylib复制到/ Users / mabelapps / Library / Developer / Xcode / DerivedData / BeatBat3-ecrdlwcmtqtujieezcmongelf /Intermediates.noindex/ArchiveIntermediates/BeatBat3/InstallationBuildProductsLocation/Applications/BeatBat3.app/Frameworks/libswiftdispatch.dylib 将/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.0/iphoneos/libswiftCore.dylib复制到/ Users / mabelapps / Library / Developer / Xcode / DerivedData / BeatBat3-ecrdlwcmtqtujieezcmongelfr /Intermediates.noindex/ArchiveIntermediates/BeatBat3/BuildProductsPath/SwiftSupport/iphoneos/libswiftCore.dylib 将/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.0/iphoneos/libswiftFoundation.dylib复制到/ Users / mabelapps / Library / Developer / Xcode / DerivedData / BeatBat3-ecrdlwcmtqtujieezcmongelfr /Intermediates.noindex/ArchiveIntermediates/BeatBat3/BuildProductsPath/SwiftSupport/iphoneos/libswiftFoundation.dylib 将/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.0/iphoneos/libswiftCoreFoundation.dylib复制到/ Users / mabelapps / Library / Developer / Xcode / DerivedData / BeatBat3-ecrdlwcmtqtujieezcmongelf /Intermediates.noindex/ArchiveIntermediates/BeatBat3/BuildProductsPath/SwiftSupport/iphoneos/libswiftCoreFoundation.dylib 将/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.0/iphoneos/libswiftCoreGraphics.dylib复制到/ Users / mabelapps / Library / Developer / Xcode / DerivedData / BeatBat3-ecrdlwcmtqtujieezcmongelf /Intermediates.noindex/ArchiveIntermediates/BeatBat3/BuildProductsPath/SwiftSupport/iphoneos/libswiftCoreGraphics.dylib 将/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.0/iphoneos/libswiftObjectiveC.dylib复制到/ Users / mabelapps / Library / Developer / Xcode / DerivedData / BeatBat3-ecrdlwcmtqtujieezcmongelf /Intermediates.noindex/ArchiveIntermediates/BeatBat3/BuildProductsPath/SwiftSupport/iphoneos/libswiftObjectiveC.dylib 将/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.0/iphoneos/libswiftDarwin.dylib复制到/ Users / mabelapps / Library / Developer / Xcode / DerivedData / BeatBat3-ecrdlwcmtqtujieezcmongelf /Intermediates.noindex/ArchiveIntermediates/BeatBat3/BuildProductsPath/SwiftSupport/iphoneos/libswiftDarwin.dylib 将/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.0/iphoneos/libswiftdispatch.dylib复制到/ Users / mabelapps / Library / Developer / Xcode / DerivedData / BeatBat3-ecrdlwcmtqtujieezcmongelf /Intermediates.noindex/ArchiveIntermediates/BeatBat3/BuildProductsPath/SwiftSupport/iphoneos/libswiftdispatch.dylib 探查/Users/mabelapps/Library/Developer/Xcode/DerivedData/BeatBat3-ecrdlwcmtqtujieezcmongelfrfw/Build/Intermediates.noindex/ArchiveIntermediates/BeatBat3/InstallationBuildProductsLocation/Applications/BeatBat3.app/Framework/libswift的签名。 / usr / bin / codesign -r- --display /Users/mabelapps/Library/Developer/Xcode/DerivedData/BeatBat3-ecrdlwcmtqtujieezcmongelfrfw/Build/Intermediates.noindex/ArchiveIntermediates/BeatBat3/InstallationBuildProductsLocation/Applications/Frameworks/BeatBat3。 .dylib 共同设计/Users/mabelapps/Library/Developer/Xcode/DerivedData/BeatBat3-ecrdlwcmtqtujieezcmongelfrfw/Build/Intermediates.noindex/ArchiveIntermediates/BeatBat3/InstallationBuildProductsLocation/Applications/BeatBat3.app/Frameworks/libswift。 / usr / bin / codesign --force --sign 5BA046D7A018CFC33DE7C29728E7C59DB93C6959 --verbose /Users/mabelapps/Library/Developer/Xcode/DerivedData/BeatBat3-ecrdlwcmtqtujieezcmongelfrfw/Build/Intermediatess.Noindex/ArchiveInterfaces。 /Frameworks/libswiftCore.dylib /Users/mabelapps/Library/Developer/Xcode/DerivedData/BeatBat3-ecrdlwcmtqtujieezcmongelfrfw/Build/Intermediates.noindex/ArchiveIntermediates/BeatBat3/InstallationBuildProductsLocation/Applications/BeatBat3.app/Frameworks/libswiftCoredydy。 /Users/mabelapps/Library/Developer/Xcode/DerivedData/BeatBat3-ecrdlwcmtqtujieezcmongelfrfw/Build/Intermediates.noindex/ArchiveIntermediates/BeatBat3/InstallationBuildProductsLocation/Applications/BeatBat3.app/Frameworks/libswiftCoreerdylib.Internal
错误:失败,退出代码为1(在项目“ BeatBat3”的目标“ BeatBat3”中)
有人可以指出我的正确方向吗?
谢谢 LeonW53
解决方法
我现在比较聪明。
要提交到Apple App Store,您需要分发证书和IOS分发证书。两者都必须具有公钥和私钥。
私钥是指从中提交应用程序的计算机。私钥是Mac的密码,它将存档应用程序并提交。
要开始,您需要进入Mac发行版并打开Keychain Access应用程序(应用程序/实用程序/ Keychain Access)。进入后,在屏幕顶部,转到“钥匙串访问/证书助手/从证书颁发机构请求证书”。
注释1 :该请求需要一个用户电子邮件地址。使用您用来登录Apple Developer Site的电子邮件地址。您不需要通用名称。选择请求已保存到磁盘并继续。您将被允许选择证书的名称和保存文件夹。点击保存。
您可以根据此一个证书签名请求创建所有证书。
进入Apple Developer网站并登录(您需要为此付费)。使用您用于保存证书的Apple ID。
转到证书,标识符和配置文件。
单击左列中的证书。单击证书旁边的+,以添加新证书。
将询问您要创建哪种证书。
您需要选择Apple Development才能在Mac上开发应用程序。您可能需要进行iOS应用开发才能开发iOS应用,但我认为没有必要
要上传和分发您的应用,您需要Apple分发和iOS分发。
选择的任何一种,请单击“继续”,然后将要求您上载签名证书请求。在这里,您浏览到保存的证书签名请求(上面的注释1)。单击生成,将创建证书。单击“下载”,证书将被下载到Mac上的“下载”文件夹中。
您可以创建几种不同类型的证书,而无需重新创建CSR,一遍又一遍地使用同一证书。
在Mac上,您只需双击下载的证书,它们就会被添加到您的钥匙串中。
在XCode中,选择“应用程序文件夹树”的应用程序根目录,然后打开“签名和功能”。从下拉列表中选择您在Apple Developer Site中拥有的团队。还要选择自动管理签名。
在XCode中,您还可以转到XCode / Preferences / Accounts。您应该选择左侧的Apple ID,该ID与您登录Apple Developer Account相同。在右侧,您可以选择要进行上传的团队,然后单击管理证书。您需要有效的iOS开发,Apple开发和Apple发行证书。
注释2 如果有任何缺少专用密钥的证书,这是因为CSR是在与当前PC不同的PC上生成的,或者您没有以相同的身份登录苹果开发人员网站上的开发人员。这发生在我身上,这是因为我没有以与在“系统偏好设置”中登录PC相同的方式登录到开发者网站。
如果您存档,并且丢失了私钥,则存档将要求您使用解锁PC的密码和每个丢失的密钥登录到钥匙串。完成后,将创建存档。
注释3 对此有任何错误,您将生成带有非零退出代码的失败归档文件。苹果没有提供有关如何解决此问题的线索。
我目前的状况是我拥有有效的Apple Development,iOS Development和Apple Distribution Certificates,并且可以存档。除了有效的Apple分发证书,我还有两个缺少私钥的Apple分发证书。但是,我可以存档该应用程序。
要友善和安全。