Xcode:*/swiftc 失败,退出代码为 11,我该怎么办?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/32176521/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Xcode : */swiftc failed with exit code 11, what can I do?
提问by testa abalez
I downloaded Xcode 7 beta 5, and I tried to compile my project with Xcode 7, and it worked. So, after that, I used Xcode 7 to develop my application, but now, I want to back to Xcode 6 but when I try to build my project, I have this issue :
我下载了 Xcode 7 beta 5,并尝试使用 Xcode 7 编译我的项目,并且成功了。所以,在那之后,我使用 Xcode 7 来开发我的应用程序,但是现在,我想回到 Xcode 6 但是当我尝试构建我的项目时,我遇到了这个问题:
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 11
What can I do to resolve that ?
我能做些什么来解决这个问题?
回答by ngn999
With the same error when compile wikipedia-ios 5.0.
编译 wikipedia-ios 5.0 时出现同样的错误。
Clean the project, then recompile, it works for me.
清理项目,然后重新编译,它对我有用。
回答by Gergely Orosz
If cleaning the project & recompiling it doesn't work then
如果清理项目并重新编译它不起作用那么
- Quit XCode
- Delete the
/Library/Developer/XCode/Derived Data
folder - Start XCode again and compile
- 退出 XCode
- 删除
/Library/Developer/XCode/Derived Data
文件夹 - 再次启动 XCode 并编译
Note: this error can happen when using XCode 6.x and XCode 7.x installed (and used) parallel.
注意:当使用并行安装(和使用)的 XCode 6.x 和 XCode 7.x 时,可能会发生此错误。
回答by kevinabraham
In my case my submodules were empty which would cause the compiler to crash a simple:
在我的情况下,我的子模块是空的,这会导致编译器崩溃一个简单的:
cd /project/file/path
git submodule init
git submodule update
Solved the issue.
解决了这个问题。
回答by Gagandeep Singh
Shift + command + k works. It will remove the errors .Then compile, It worked for me.
Shift + command + k 有效。它将删除错误。然后编译,它对我有用。
回答by Edison
The xctoolchain error can sometimes be caused by Xcode not finding the location of source files in a project that was moved or started by someone else who had a different project location in their own Finder.
xctoolchain 错误有时可能是由于 Xcode 没有在项目中找到源文件的位置,而该项目是由其他人在他们自己的 Finder 中移动或启动的不同项目位置引起的。
If you're working on another project started by someone else such as a GitHub open source project, Xcode can mistake the location of the source files.
如果您正在处理其他人启动的另一个项目,例如 GitHub 开源项目,Xcode 可能会弄错源文件的位置。
Xcode may think ViewController.swift is still in the project folder on the creator's desktop when it's actually on your own desktop. In this case some of your source files may be red because Xcode cannot find them.
Xcode 可能认为 ViewController.swift 仍在创建者桌面上的项目文件夹中,而实际上它在您自己的桌面上。在这种情况下,您的某些源文件可能是红色的,因为 Xcode 找不到它们。
Go to the Xcode Identity Inspector on the right side and in the Identity and Type section you'll see the Location pulldown.
Select a red missing file in the Project Navigator on the left.
Make sure the Identity Inspector pulldown is set to 'Relative To Group'.
Click the folder icon underneath to navigate to the real file location, select your file and click Choose. The Full Path will now reflect the correct location.
Clean and rebuild.
转到右侧的 Xcode Identity Inspector,在 Identity and Type 部分,您将看到 Location 下拉菜单。
在左侧的项目导航器中选择一个红色的缺失文件。
确保 Identity Inspector 下拉菜单设置为“Relative To Group”。
单击下方的文件夹图标导航到实际文件位置,选择您的文件并单击选择。完整路径现在将反映正确的位置。
清洁和重建。
回答by pradeepchauhan_pc
Clean your project and compile again. Short cut keys: Shift + Command + k
清理您的项目并再次编译。快捷键:Shift + Command + k
回答by Dnyaneshwar Shinde
What worked for me
什么对我有用
- Delete Application from iPhone or simulator.
- Clean Project
- Run again
- 从 iPhone 或模拟器删除应用程序。
- 清洁工程
- 再次运行