XCode 8 错误“项目错误:Xcode 未正确设置”,即使许可证已被接受
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/39492617/
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 8 error "Project ERROR: Xcode not set up properly", even though the license has been accepted
提问by Violet Giraffe
I can no longer build Qt project after updating to Xcode 8 today. I get the following error despite having followed the instructions from this answer.
今天更新到 Xcode 8 后,我无法再构建 Qt 项目。尽管已按照此答案中的说明进行操作,但仍收到以下错误。
Project ERROR: Xcode not set up properly. You may need to confirm the license agreement by running /usr/bin/xcodebuild.
项目错误:Xcode 设置不正确。您可能需要通过运行 /usr/bin/xcodebuild 来确认许可协议。
How to fix it?
如何解决?
回答by Whatcould
I managed to get capybara-webkit (which uses QT) built with XCode 8 / MacOX Sierra after following these instructions (found here: https://forum.qt.io/topic/71119/project-error-xcode-not-set-up-properly/7)
按照这些说明(在此处找到:https://forum.qt.io/topic/71119/project-error-xcode-not-set),我设法获得了使用 XCode 8 / MacOX Sierra 构建的 capybara-webkit(使用 QT)-up-properly/7)
- Move to the folder where you install Qt.
- Open in a text editor the file at Qt_install_folder/5.7/clang_64/mkspecs/features/mac/default_pre.prf
Find the line with text (for me it was line 15):
isEmpty($$list($$system("/usr/bin/xcrun -find xcrun 2>/dev/null")))): \
Replace line with:
isEmpty($$list($$system("/usr/bin/xcrun -find xcodebuild 2>/dev/null"))): \
Save & re-compile
- 移动到安装 Qt 的文件夹。
- 在文本编辑器中打开位于 Qt_install_folder/5.7/clang_64/mkspecs/features/mac/default_pre.prf 的文件
找到带有文本的行(对我来说是第 15 行):
isEmpty($$list($$system("/usr/bin/xcrun -find xcrun 2>/dev/null")))): \
将行替换为:
isEmpty($$list($$system("/usr/bin/xcrun -find xcodebuild 2>/dev/null"))): \
保存并重新编译
回答by Daniel Georgiev
A cleaner solution
更清洁的解决方案
cd /Applications/Xcode.app/Contents/Developer/usr/bin/
sudo ln -s xcodebuild xcrun
回答by Sergei
Run MaintenanceTool in Qt directory and update to version 5.8
在Qt目录下运行MaintenanceTool并更新到5.8版