Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Command ...swiftc failed with exit code 1

I am stuck with this error for a while, and none of the solutions I've found seems to work (at least, in my case). Here is the full error log:

CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler
cd "/Users/user/Documents/Music Kit A"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc -target x86_64-apple-macosx10.10 -module-name Music_Kit_A -Onone -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -g -module-cache-path /Users/user/Library/Developer/Xcode/DerivedData/ModuleCache -I /Users/user/Library/Developer/Xcode/DerivedData/Music_Kit_A-cimwnaollginmxefzprqiioyrhfl/Build/Products/Debug -F /Users/user/Library/Developer/Xcode/DerivedData/Music_Kit_A-cimwnaollginmxefzprqiioyrhfl/Build/Products/Debug -c -j4 /Users/user/Documents/Music\ Kit\ A/Music\ Kit\ A/AppDelegate.swift /Users/user/Documents/Music\ Kit\ A/Music\ Kit\ A/main.swift -output-file-map /Users/user/Library/Developer/Xcode/DerivedData/Music_Kit_A-cimwnaollginmxefzprqiioyrhfl/Build/Intermediates/Music\ Kit\ A.build/Debug/Music\ Kit\ A.build/Objects-normal/x86_64/Music\ Kit\ A-OutputFileMap.json -parseable-output -serialize-diagnostics -emit-dependencies -emit-module -emit-module-path /Users/user/Library/Developer/Xcode/DerivedData/Music_Kit_A-cimwnaollginmxefzprqiioyrhfl/Build/Intermediates/Music\ Kit\ A.build/Debug/Music\ Kit\ A.build/Objects-normal/x86_64/Music_Kit_A.swiftmodule -Xcc -I/Users/user/Library/Developer/Xcode/DerivedData/Music_Kit_A-cimwnaollginmxefzprqiioyrhfl/Build/Intermediates/Music\ Kit\ A.build/Debug/Music\ Kit\ A.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/user/Library/Developer/Xcode/DerivedData/Music_Kit_A-cimwnaollginmxefzprqiioyrhfl/Build/Intermediates/Music\ Kit\ A.build/Debug/Music\ Kit\ A.build/Music\ Kit\ A-generated-files.hmap -Xcc -I/Users/user/Library/Developer/Xcode/DerivedData/Music_Kit_A-cimwnaollginmxefzprqiioyrhfl/Build/Intermediates/Music\ Kit\ A.build/Debug/Music\ Kit\ A.build/Music\ Kit\ A-own-target-headers.hmap -Xcc -I/Users/user/Library/Developer/Xcode/DerivedData/Music_Kit_A-cimwnaollginmxefzprqiioyrhfl/Build/Intermediates/Music\ Kit\ A.build/Debug/Music\ Kit\ A.build/Music\ Kit\ A-all-target-headers.hmap -Xcc -iquote -Xcc /Users/user/Library/Developer/Xcode/DerivedData/Music_Kit_A-cimwnaollginmxefzprqiioyrhfl/Build/Intermediates/Music\ Kit\ A.build/Debug/Music\ Kit\ A.build/Music\ Kit\ A-project-headers.hmap -Xcc -I/Users/user/Library/Developer/Xcode/DerivedData/Music_Kit_A-cimwnaollginmxefzprqiioyrhfl/Build/Products/Debug/include -Xcc -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -Xcc -I/Users/user/Library/Developer/Xcode/DerivedData/Music_Kit_A-cimwnaollginmxefzprqiioyrhfl/Build/Intermediates/Music\ Kit\ A.build/Debug/Music\ Kit\ A.build/DerivedSources/x86_64 -Xcc -I/Users/user/Library/Developer/Xcode/DerivedData/Music_Kit_A-cimwnaollginmxefzprqiioyrhfl/Build/Intermediates/Music\ Kit\ A.build/Debug/Music\ Kit\ A.build/DerivedSources -Xcc -DDEBUG=1 -emit-objc-header -emit-objc-header-path /Users/user/Library/Developer/Xcode/DerivedData/Music_Kit_A-cimwnaollginmxefzprqiioyrhfl/Build/Intermediates/Music\ Kit\ A.build/Debug/Music\ Kit\ A.build/Objects-normal/x86_64/Music_Kit_A-Swift.h

Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1

What I've tried:

  • Clean the project

  • Comment my last changes

  • Create a new project and transfer the code

When I create a new project, this error goes away, but get another one saying that there is an implicit entry point to main. Searched the whole project for a main function, but nothing showed up. My whole code is here, if it's of any use.

like image 609
user26830 Avatar asked Oct 29 '14 23:10

user26830


2 Answers

Try to use xcodebuild -project ***.xcodeproj -scheme ***, it will give you more details about the error.

For me was adding [unowned self] to a block inside a block.

like image 157
tony508 Avatar answered Oct 31 '22 23:10

tony508


In my case this code causes the error:

processBtn.setTitleColor(.whiteColor(), forState: .Normal)

But if i add UIColor everything goes fine:

processBtn.setTitleColor(UIColor.whiteColor(), forState: .Normal)

Maybe you have similar errors in you code.

like image 42
Amin Benarieb Avatar answered Oct 31 '22 21:10

Amin Benarieb