命令... swiftc失败,退出代码为1

时间:2014-10-29 23:07:11

标签: xcode swift xcode6

我暂时遇到这个错误,我找到的解决方案似乎都没有用(至少在我的情况下)。这是完整的错误日志:

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

我尝试了什么:

  • 清理项目

  • 评论我的上一次更改

  • 创建新项目并传输代码

当我创建一个新项目时,此错误消失了,但另一个错误说明main有一个隐含的入口点。搜索整个项目的主要功能,但没有任何显示。我的整个代码是here,如果它有用的话。

3 个答案:

答案 0 :(得分:6)

尝试使用xcodebuild -project ***.xcodeproj -scheme ***,它会为您提供有关错误的更多详细信息。

对我来说,是将[unowned self]添加到块内的块中。

答案 1 :(得分:1)

在我的情况下,此代码会导致错误:

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

但如果我添加UIColor一切顺利:

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

也许你的代码中有类似的错误。

答案 2 :(得分:0)

对于现在遇到此问题的其他人。请还原以前删除的系统中的文件。

您的项目可能仍在项目中的某个位置引用该文件。