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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 08:11:09  来源:igfitidea点击:

The project named "Foo does not contain a scheme named "Bar" bitrise.io

iosxcodexcodebuildbitrise

提问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.

要使您的架构对命令行构建可见,您必须将其标记为共享方案。

  1. From the menu bar, select Product > Scheme > Manage Schemes
  2. Ensure the 'Shared' box is checked for that scheme
  3. A new .xcscheme file has been created in your project at
    WorkspaceName.xcworkspace/xcshareddata/xcschemes.
  4. Commit this file to your repository
  1. 从菜单栏中,选择产品 > 方案 > 管理方案
  2. 确保为该方案选中“共享”框
  3. 已在您的项目中的
    WorkspaceName.xcworkspace/xcshareddata/xcschemes 中创建了一个新的 .xcscheme 文件。
  4. 将此文件提交到您的存储库

回答by yqbk

If you don't use cocoapods in your project you should remove .xcworkspacefile from ./iosdirectory.

如果你不在你的项目中使用 cocoapods,你应该.xcworkspace./ios目录中删除文件。

回答by Haseeb Eqx

If this is happened after a project rename this is manually fixable

如果这是在项目重命名后发生的,则可以手动修复

  1. Open Fooas a directory in finder.
  2. Open the folder xcshareddata/xcschemes
  3. Rename the xcschemefiles there
  1. Foo在finder中作为目录打开。
  2. 打开文件夹 xcshareddata/xcschemes
  3. 重命名xcscheme那里的文件

回答by Chinedu Ofor

Make sure you have CocoaPodsinstalled.

确保你安装了CocoaPods

In Terminal, switch (cd) to your project's directory. Once there, run pod installand the program will download the required files.

在终端中,切换 ( cd) 到您的项目目录。在那里,运行pod install,程序将下载所需的文件。