Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I just configure a project in bitrise.io. But the xcode-build fails with error:

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 Bar does exist in the project Foo

like image 300
Guilherme Torres Castro Avatar asked Nov 04 '15 12:11

Guilherme Torres Castro


People also ask

How do I know what scheme my Xcode project is?

In Xcode Go to Products>Scheme>Manage Scheme and check share to share. Set absolute path everywhere. here you need to change /path/to/your/project/ with your path and testDemo with your project name.

What is Xcode scheme?

An Xcode scheme defines a collection of targets to build, a configuration to use when building, and a collection of tests to execute.


3 Answers

Based on the Bryan Mussial answer

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.

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
like image 183
Guilherme Torres Castro Avatar answered Nov 03 '22 13:11

Guilherme Torres Castro


If you don't use cocoapods in your project you should remove .xcworkspace file from ./ios directory.

like image 34
yqbk Avatar answered Nov 03 '22 12:11

yqbk


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

  1. Open Foo as a directory in finder.
  2. Open the folder xcshareddata/xcschemes
  3. Rename the xcscheme files there
like image 16
Haseeb A Avatar answered Nov 03 '22 11:11

Haseeb A