How Do You Fix The 'Failed code 1' problem While Archiving Your App

Hello everyone,

I seem to have run into a problem while trying to launch my first app. While I was trying to archive my app to the 'Build' section of the phase, it can up with this:



CompileSwift normal arm64 /Users/user/Desktop/My\ app/XLMaths/Rapid\ Maths/allQuestions.swift (in target: XLMaths)

cd /Users/user/Desktop/My\ app/XLMaths

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c -primary-file /Users/user/Desktop/My\ app/XLMaths/Rapid\ Maths/allQuestions.swift /Users/user/Desktop/My\ app/XLMaths/Rapid\ Maths/Question.swift /Users/user/Desktop/My\ app/XLMaths/Rapid\ Maths/ViewController.swift /Users/user/Desktop/My\ app/XLMaths/Rapid\ Maths/AppDelegate.swift -emit-module-path /Users/user/Library/Developer/Xcode/DerivedData/XLMaths-byeaqcqnvfnhosdoajdnbiokodub/Build/Intermediates.noindex/XLMaths.build/Debug-iphoneos/XLMaths.build/Objects-normal/arm64/allQuestions~partial.swiftmodule -emit-module-doc-path /Users/user/Library/Developer/Xcode/DerivedData/XLMaths-byeaqcqnvfnhosdoajdnbiokodub/Build/Intermediates.noindex/XLMaths.build/Debug-iphoneos/XLMaths.build/Objects-normal/arm64/allQuestions~partial.swiftdoc -serialize-diagnostics-path /Users/user/Library/Developer/Xcode/DerivedData/XLMaths-byeaqcqnvfnhosdoajdnbiokodub/Build/Intermediates.noindex/XLMaths.build/Debug-iphoneos/XLMaths.build/Objects-normal/arm64/allQuestions.dia -emit-dependencies-path /Users/user/Library/Developer/Xcode/DerivedData/XLMaths-byeaqcqnvfnhosdoajdnbiokodub/Build/Intermediates.noindex/XLMaths.build/Debug-iphoneos/XLMaths.build/Objects-normal/arm64/allQuestions.d -emit-reference-dependencies-path /Users/user/Library/Developer/Xcode/DerivedData/XLMaths-byeaqcqnvfnhosdoajdnbiokodub/Build/Intermediates.noindex/XLMaths.build/Debug-iphoneos/XLMaths.build/Objects-normal/arm64/allQuestions.swiftdeps -target arm64-apple-ios12.1 -Xllvm -aarch64-use-tbi -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk -I /Users/user/Library/Developer/Xcode/DerivedData/XLMaths-byeaqcqnvfnhosdoajdnbiokodub/Build/Products/Debug-iphoneos -F /Users/user/Library/Developer/Xcode/DerivedData/XLMaths-byeaqcqnvfnhosdoajdnbiokodub/Build/Products/Debug-iphoneos -enable-testing -g -module-cache-path /Users/user/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -swift-version 4.2 -enforce-exclusivity=checked -Onone -D DEBUG -serialize-debugging-options -Xcc -I/Users/user/Library/Developer/Xcode/DerivedData/XLMaths-byeaqcqnvfnhosdoajdnbiokodub/Build/Intermediates.noindex/XLMaths.build/Debug-iphoneos/XLMaths.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/user/Library/Developer/Xcode/DerivedData/XLMaths-byeaqcqnvfnhosdoajdnbiokodub/Build/Intermediates.noindex/XLMaths.build/Debug-iphoneos/XLMaths.build/XLMaths-generated-files.hmap -Xcc -I/Users/user/Library/Developer/Xcode/DerivedData/XLMaths-byeaqcqnvfnhosdoajdnbiokodub/Build/Intermediates.noindex/XLMaths.build/Debug-iphoneos/XLMaths.build/XLMaths-own-target-headers.hmap -Xcc -I/Users/user/Library/Developer/Xcode/DerivedData/XLMaths-byeaqcqnvfnhosdoajdnbiokodub/Build/Intermediates.noindex/XLMaths.build/Debug-iphoneos/XLMaths.build/XLMaths-all-target-headers.hmap -Xcc -iquote -Xcc /Users/user/Library/Developer/Xcode/DerivedData/XLMaths-byeaqcqnvfnhosdoajdnbiokodub/Build/Intermediates.noindex/XLMaths.build/Debug-iphoneos/XLMaths.build/XLMaths-project-headers.hmap -Xcc -I/Users/user/Library/Developer/Xcode/DerivedData/XLMaths-byeaqcqnvfnhosdoajdnbiokodub/Build/Products/Debug-iphoneos/include -Xcc -I/Users/user/Library/Developer/Xcode/DerivedData/XLMaths-byeaqcqnvfnhosdoajdnbiokodub/Build/Intermediates.noindex/XLMaths.build/Debug-iphoneos/XLMaths.build/DerivedSources/arm64 -Xcc -I/Users/user/Library/Developer/Xcode/DerivedData/XLMaths-byeaqcqnvfnhosdoajdnbiokodub/Build/Intermediates.noindex/XLMaths.build/Debug-iphoneos/XLMaths.build/DerivedSources -Xcc -DDEBUG=1 -Xcc -working-directory/Users/user/Desktop/My\ app/XLMaths -module-name XLMaths -o /Users/user/Library/Developer/Xcode/DerivedData/XLMaths-byeaqcqnvfnhosdoajdnbiokodub/Build/Intermediates.noindex/XLMaths.build/Debug-iphoneos/XLMaths.build/Objects-normal/arm64/allQuestions.o -embed-bitcode-marker -index-store-path /Users/user/Library/Developer/Xcode/DerivedData/XLMaths-byeaqcqnvfnhosdoajdnbiokodub/Index/DataStore -index-system-modules


Command CompileSwift failed with a nonzero exit code


Do you know how to fix it? If so please help me...

Accepted Reply

This thread has been deleted

Nevermind, I found out the problem I appreciate your time though and thanks for trying to help! 🙂

Replies

Remember, you can't archive if:

- a simulator is selected instead of a device*

- there is an error when building*

- you haven't finished the 'Prepare for Submission’ stage for that app in App Store Connect

- See: https://developer.apple.com/library/ios/documentation/LanguagesUtilities/Conceptual/iTunesConnect_Guide/Chapters/ChangingAppStatus.html

- you've recently renewed your (required) apple developer account, and not yet updated the provisions to reflect that activity



* You must have at least one device registered in the Member Center, but it doesn’t have to be connected to your Mac/Xcode when building, in which case select ‘generic iOS/tvOS device'

- - - If this is just about testing to a device and you're getting a message that Xcode can't archive, try deleting all older versions of that app on the target device first


Also see TN2215: Why is the Archive menu item grayed out in Xcode ?

Post not yet marked as solved Up vote reply of KMT Down vote reply of KMT

flutter upgrade solved problem for me