0
votes

I have an Xcode project (Xcode 11.5). It runs in the simulator and on my own device fine and without any errors. But when I archive it, this happens:

CopySwiftLibs /Users/mabelapps/Library/Developer/Xcode/DerivedData/BeatBat3-ecrdlwcmtqtujieezcmongelfrfw/Build/Intermediates.noindex/ArchiveIntermediates/BeatBat3/InstallationBuildProductsLocation/Applications/BeatBat3.app (in target 'BeatBat3' from project 'BeatBat3') cd /Users/mabelapps/Library/Mobile\ Documents/com~apple~CloudDocs/XCode\ Projects/BeatBat3 export CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate export DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer export SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk builtin-swiftStdLibTool --copy --verbose --sign 5BA046D7A018CFC33DE7C29728E7C59DB93C6959 --scan-executable /Users/mabelapps/Library/Developer/Xcode/DerivedData/BeatBat3-ecrdlwcmtqtujieezcmongelfrfw/Build/Intermediates.noindex/ArchiveIntermediates/BeatBat3/InstallationBuildProductsLocation/Applications/BeatBat3.app/BeatBat3 --scan-folder /Users/mabelapps/Library/Developer/Xcode/DerivedData/BeatBat3-ecrdlwcmtqtujieezcmongelfrfw/Build/Intermediates.noindex/ArchiveIntermediates/BeatBat3/InstallationBuildProductsLocation/Applications/BeatBat3.app/Frameworks --scan-folder /Users/mabelapps/Library/Developer/Xcode/DerivedData/BeatBat3-ecrdlwcmtqtujieezcmongelfrfw/Build/Intermediates.noindex/ArchiveIntermediates/BeatBat3/InstallationBuildProductsLocation/Applications/BeatBat3.app/PlugIns --scan-folder /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.5.sdk/System/Library/Frameworks/StoreKit.framework --platform iphoneos --toolchain /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain --destination /Users/mabelapps/Library/Developer/Xcode/DerivedData/BeatBat3-ecrdlwcmtqtujieezcmongelfrfw/Build/Intermediates.noindex/ArchiveIntermediates/BeatBat3/InstallationBuildProductsLocation/Applications/BeatBat3.app/Frameworks --unsigned-destination /Users/mabelapps/Library/Developer/Xcode/DerivedData/BeatBat3-ecrdlwcmtqtujieezcmongelfrfw/Build/Intermediates.noindex/ArchiveIntermediates/BeatBat3/BuildProductsPath/SwiftSupport --emit-dependency-info /Users/mabelapps/Library/Developer/Xcode/DerivedData/BeatBat3-ecrdlwcmtqtujieezcmongelfrfw/Build/Intermediates.noindex/ArchiveIntermediates/BeatBat3/IntermediateBuildFilesPath/BeatBat3.build/Release-iphoneos/BeatBat3.build/SwiftStdLibToolInputDependencies.dep

Copying /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.0/iphoneos/libswiftCore.dylib to /Users/mabelapps/Library/Developer/Xcode/DerivedData/BeatBat3-ecrdlwcmtqtujieezcmongelfrfw/Build/Intermediates.noindex/ArchiveIntermediates/BeatBat3/InstallationBuildProductsLocation/Applications/BeatBat3.app/Frameworks/libswiftCore.dylib Copying /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.0/iphoneos/libswiftFoundation.dylib to /Users/mabelapps/Library/Developer/Xcode/DerivedData/BeatBat3-ecrdlwcmtqtujieezcmongelfrfw/Build/Intermediates.noindex/ArchiveIntermediates/BeatBat3/InstallationBuildProductsLocation/Applications/BeatBat3.app/Frameworks/libswiftFoundation.dylib Copying /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.0/iphoneos/libswiftCoreFoundation.dylib to /Users/mabelapps/Library/Developer/Xcode/DerivedData/BeatBat3-ecrdlwcmtqtujieezcmongelfrfw/Build/Intermediates.noindex/ArchiveIntermediates/BeatBat3/InstallationBuildProductsLocation/Applications/BeatBat3.app/Frameworks/libswiftCoreFoundation.dylib Copying /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.0/iphoneos/libswiftCoreGraphics.dylib to /Users/mabelapps/Library/Developer/Xcode/DerivedData/BeatBat3-ecrdlwcmtqtujieezcmongelfrfw/Build/Intermediates.noindex/ArchiveIntermediates/BeatBat3/InstallationBuildProductsLocation/Applications/BeatBat3.app/Frameworks/libswiftCoreGraphics.dylib Copying /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.0/iphoneos/libswiftObjectiveC.dylib to /Users/mabelapps/Library/Developer/Xcode/DerivedData/BeatBat3-ecrdlwcmtqtujieezcmongelfrfw/Build/Intermediates.noindex/ArchiveIntermediates/BeatBat3/InstallationBuildProductsLocation/Applications/BeatBat3.app/Frameworks/libswiftObjectiveC.dylib Copying /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.0/iphoneos/libswiftDarwin.dylib to /Users/mabelapps/Library/Developer/Xcode/DerivedData/BeatBat3-ecrdlwcmtqtujieezcmongelfrfw/Build/Intermediates.noindex/ArchiveIntermediates/BeatBat3/InstallationBuildProductsLocation/Applications/BeatBat3.app/Frameworks/libswiftDarwin.dylib Copying /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.0/iphoneos/libswiftDispatch.dylib to /Users/mabelapps/Library/Developer/Xcode/DerivedData/BeatBat3-ecrdlwcmtqtujieezcmongelfrfw/Build/Intermediates.noindex/ArchiveIntermediates/BeatBat3/InstallationBuildProductsLocation/Applications/BeatBat3.app/Frameworks/libswiftDispatch.dylib Copying /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.0/iphoneos/libswiftCore.dylib to /Users/mabelapps/Library/Developer/Xcode/DerivedData/BeatBat3-ecrdlwcmtqtujieezcmongelfrfw/Build/Intermediates.noindex/ArchiveIntermediates/BeatBat3/BuildProductsPath/SwiftSupport/iphoneos/libswiftCore.dylib Copying /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.0/iphoneos/libswiftFoundation.dylib to /Users/mabelapps/Library/Developer/Xcode/DerivedData/BeatBat3-ecrdlwcmtqtujieezcmongelfrfw/Build/Intermediates.noindex/ArchiveIntermediates/BeatBat3/BuildProductsPath/SwiftSupport/iphoneos/libswiftFoundation.dylib Copying /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.0/iphoneos/libswiftCoreFoundation.dylib to /Users/mabelapps/Library/Developer/Xcode/DerivedData/BeatBat3-ecrdlwcmtqtujieezcmongelfrfw/Build/Intermediates.noindex/ArchiveIntermediates/BeatBat3/BuildProductsPath/SwiftSupport/iphoneos/libswiftCoreFoundation.dylib Copying /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.0/iphoneos/libswiftCoreGraphics.dylib to /Users/mabelapps/Library/Developer/Xcode/DerivedData/BeatBat3-ecrdlwcmtqtujieezcmongelfrfw/Build/Intermediates.noindex/ArchiveIntermediates/BeatBat3/BuildProductsPath/SwiftSupport/iphoneos/libswiftCoreGraphics.dylib Copying /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.0/iphoneos/libswiftObjectiveC.dylib to /Users/mabelapps/Library/Developer/Xcode/DerivedData/BeatBat3-ecrdlwcmtqtujieezcmongelfrfw/Build/Intermediates.noindex/ArchiveIntermediates/BeatBat3/BuildProductsPath/SwiftSupport/iphoneos/libswiftObjectiveC.dylib Copying /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.0/iphoneos/libswiftDarwin.dylib to /Users/mabelapps/Library/Developer/Xcode/DerivedData/BeatBat3-ecrdlwcmtqtujieezcmongelfrfw/Build/Intermediates.noindex/ArchiveIntermediates/BeatBat3/BuildProductsPath/SwiftSupport/iphoneos/libswiftDarwin.dylib Copying /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5.0/iphoneos/libswiftDispatch.dylib to /Users/mabelapps/Library/Developer/Xcode/DerivedData/BeatBat3-ecrdlwcmtqtujieezcmongelfrfw/Build/Intermediates.noindex/ArchiveIntermediates/BeatBat3/BuildProductsPath/SwiftSupport/iphoneos/libswiftDispatch.dylib Probing signature of /Users/mabelapps/Library/Developer/Xcode/DerivedData/BeatBat3-ecrdlwcmtqtujieezcmongelfrfw/Build/Intermediates.noindex/ArchiveIntermediates/BeatBat3/InstallationBuildProductsLocation/Applications/BeatBat3.app/Frameworks/libswiftCore.dylib /usr/bin/codesign -r- --display /Users/mabelapps/Library/Developer/Xcode/DerivedData/BeatBat3-ecrdlwcmtqtujieezcmongelfrfw/Build/Intermediates.noindex/ArchiveIntermediates/BeatBat3/InstallationBuildProductsLocation/Applications/BeatBat3.app/Frameworks/libswiftCore.dylib Codesigning /Users/mabelapps/Library/Developer/Xcode/DerivedData/BeatBat3-ecrdlwcmtqtujieezcmongelfrfw/Build/Intermediates.noindex/ArchiveIntermediates/BeatBat3/InstallationBuildProductsLocation/Applications/BeatBat3.app/Frameworks/libswiftCore.dylib /usr/bin/codesign --force --sign 5BA046D7A018CFC33DE7C29728E7C59DB93C6959 --verbose /Users/mabelapps/Library/Developer/Xcode/DerivedData/BeatBat3-ecrdlwcmtqtujieezcmongelfrfw/Build/Intermediates.noindex/ArchiveIntermediates/BeatBat3/InstallationBuildProductsLocation/Applications/BeatBat3.app/Frameworks/libswiftCore.dylib /Users/mabelapps/Library/Developer/Xcode/DerivedData/BeatBat3-ecrdlwcmtqtujieezcmongelfrfw/Build/Intermediates.noindex/ArchiveIntermediates/BeatBat3/InstallationBuildProductsLocation/Applications/BeatBat3.app/Frameworks/libswiftCore.dylib: replacing existing signature /Users/mabelapps/Library/Developer/Xcode/DerivedData/BeatBat3-ecrdlwcmtqtujieezcmongelfrfw/Build/Intermediates.noindex/ArchiveIntermediates/BeatBat3/InstallationBuildProductsLocation/Applications/BeatBat3.app/Frameworks/libswiftCore.dylib: errSecInternalComponent

error: Failed with exit code 1 (in target 'BeatBat3' from project 'BeatBat3')


Can anyone point me in the right direction, please?

Thanks LeonW53

1
That is a whoooooole lotta messages to read thru, maybe a screenshot would help? But it sounds like your got a code signing issue going on. Check your Apple developer account and make sure your code signing is all set up properly, then verify those setting in your app.Lkabo

1 Answers

0
votes

I am a little the wiser now.

In order to submit to the Apple App Store, you need a Distribution Certificate and an IOS Distribution Certificate. Both must have the Public and Private key.

The Private Key refers to the computer from which the app will be submitted. The Private Key is password to the Mac that will archive the app and submit.

To start, you need to go onto your distribution Mac and open the Keychain Access app (Applications/Utilities/Keychain Access). Once in, at the top of the screen, go to Keychain Access/Certificate Assistant/Request a Certificate from a Certificate Authority.

Note 1The Request requires a user email address. Use the email address that you use to log into the Apple Developer Site. You do not need a common name. Select Request is Saved to Disk and Continue. You will be allowed to pick the name and Save Folder for the Certificate. Click Save.

You can create All of your Certificates from this one Certificate Signing Request.

Go into the Apple Developer Website and sign in (you need to be paid up to do this). Use the Apple ID that you used to save the Certificate.

Go to Certificates, Identifiers and Profiles.

Click Certificates in the left column. Click the + next to Certificates to add a new Certificate.

You will be asked to what kind of Certificate to Create.

You need to select Apple Development to develop an app on your mac. You may need an iOS App Development to develop iOS apps, but I haven't found this necessary

To Upload and Distribute your app, you need Apple Distribution and iOS Distribution.

Whichever one you pick, click Continue and you will be asked to Upload a Signing Certificate Request. Here you browse to the Certificate Signing Request that you saved (Note 1 above). Click Generate and the Certificate will be created. Click Download and the Certificate will be downloaded to the Downloads folder on your Mac.

You can create several different kind of certificates and you do NOT need to re-create the CSR -- use the same one over and over.

On your Mac, you can just double click the Certificates downloaded and they will be added to your Keychain.

In XCode, select the App root of the App Folder Tree and open "Signing and Capabilities". Select the Team that you have in the Apple Developer Site from the drop down list. Also select Automatically manage signings.

Also in XCode, you go to XCode/Preferences/Accounts. You should selected the Apple ID on the left which is the same as you log into the Apple Developer Account. On the right, you can select the Team which will do the Uploading and click Manage Certificates. You need valid iOS Development, Apple Development and Apple Distribution Certificates.

Note 2 If there are any Certificates that are missing the Private Key, this is because either the CSR was generated on a different PC to your current PC or that you were not logged in as the same developer on the Apple Developer Site. This happened to me, and it was because I wasn't logged into the Developer Site the same as I have logged on my PC in System Preferences.

If you Archive, and you have missing Private Keys, the Archive will ask you to log into Keychain using the password which unlocks the PC for EACH and every missing key. Once done, the archive will be created.

Note 3Make any mistake on this, and you will generate a failed archive with a non-zero exit code. Apple provide no clue as to how to solve this.

My current situation is that I have valid Apple Development, iOS Development and Apple Distribution Certificates and I can archive. In addition to the valid Apple Distribution Certificate, I have two Apple Distribution Certificates which are missing private keys. But, I can archive the app.

Be kind and be safe all.