ios 名为“Foo 的项目不包含名为“Bar”的方案 bitrise.io
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/33521526/
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
The project named "Foo does not contain a scheme named "Bar" bitrise.io
提问by Guilherme Torres Castro
I just configure a project in bitrise.io. But the xcode-build fails with error:
我只是在 bitrise.io 中配置了一个项目。但是 xcode-build 失败并出现错误:
xcodebuild: error: The project named "Foo" does not contain a scheme named "Bar". The "-list" option can be used to find the names of the schemes in the project.
I double check and the scheme Bardoes exist in the project Foo
我仔细检查,计划Bar确实存在于项目Foo 中
回答by Guilherme Torres Castro
Based on the Bryan Mussialanswer
基于Bryan Mussial 的回答
The root cause is that the default behavior of Schemes is to keep schemes 'private' until they are specifically marked as shared. In the case of a command-line initiated build, the Xcode UI never runs and the xcoderun tool doesn't have its own cache of Schemes to work with.
根本原因是 Schemes 的默认行为是将方案保持为“私有”,直到它们被明确标记为共享。在命令行启动构建的情况下,Xcode UI 永远不会运行,并且 xcoderun 工具没有自己的 Schemes 缓存可以使用。
To your schema be visible for command-line build you must mark it as a shared scheme.
要使您的架构对命令行构建可见,您必须将其标记为共享方案。
- From the menu bar, select Product > Scheme > Manage Schemes
- Ensure the 'Shared' box is checked for that scheme
- A new .xcscheme file has been created in your project at
WorkspaceName.xcworkspace/xcshareddata/xcschemes. - Commit this file to your repository
- 从菜单栏中,选择产品 > 方案 > 管理方案
- 确保为该方案选中“共享”框
- 已在您的项目中的
WorkspaceName.xcworkspace/xcshareddata/xcschemes 中创建了一个新的 .xcscheme 文件。 - 将此文件提交到您的存储库
回答by yqbk
If you don't use cocoapods in your project you should remove .xcworkspace
file from ./ios
directory.
如果你不在你的项目中使用 cocoapods,你应该.xcworkspace
从./ios
目录中删除文件。
回答by Haseeb Eqx
If this is happened after a project rename this is manually fixable
如果这是在项目重命名后发生的,则可以手动修复
- Open
Foo
as a directory in finder. - Open the folder
xcshareddata/xcschemes
- Rename the
xcscheme
files there
Foo
在finder中作为目录打开。- 打开文件夹
xcshareddata/xcschemes
- 重命名
xcscheme
那里的文件