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

IosXcodeXcodebuildBitrise

Ios Problem Overview


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

Ios Solutions


Solution 1 - Ios

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

Solution 2 - Ios

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

Solution 3 - Ios

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

Solution 4 - Ios

You can follow the instruction as in the image below.

enter image description here

Solution 5 - Ios

Solution 1::

On XCode:

1 - Go to Product/Scheme/Manager Schemes...
2 - Select the Scheme you want to create and click on the "Edit" button.
3 - Uncheck and check again the "Shared" checkbox.

Solution 2:

On Finder:

1 - Go to YOUR_PROJECT.xcodeproj/xcshareddata.
2 - Copy the xcschemes folder.
3 - Go to YOUR_PROJECT.xcworkspace/xcshareddata.
4 - Paste the xcschemes folder

Solution 6 - Ios

Make sure you have CocoaPods installed.

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

Solution 7 - Ios

I got the same issue after returning my mac to factory settings and essentially updating it to Big Sur.

You should definitely first check if your schemes are checked as "Shared". Then, in xcode -> preferences -> locations, see if your current version of xcode is selected in the field "Command Line Tools".

Also, make sure that you have a scheme with the exact name that the error is saying ("bar", not "bar.dev"). That scheme can be empty (no actions or anything). Your schemes should also be in the yourappname Workspace (that's when you open "Manage schemes").

Finally what actually fixed it for me was this:

  1. cd ios
  2. pod deintegrate
  3. pod install
  4. cd ..
  5. run your app

Solution 8 - Ios

I was getting this error when I changed project name in xcode

it created new [new_name].xcworkspace

if your ios folder has [old_name].xcworkspace

then delete: [old_name].xcworkspace

and run again!

Solution 9 - Ios

Expo only: after manually changing the name, I had to regenerate the project using expo run:ios.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionGuilherme Torres CastroView Question on Stackoverflow
Solution 1 - IosGuilherme Torres CastroView Answer on Stackoverflow
Solution 2 - IosyqbkView Answer on Stackoverflow
Solution 3 - IosHaseeb AView Answer on Stackoverflow
Solution 4 - IosAlish GiriView Answer on Stackoverflow
Solution 5 - IosCarlFerrView Answer on Stackoverflow
Solution 6 - IosChinedu OforView Answer on Stackoverflow
Solution 7 - IosYavor DaskalovView Answer on Stackoverflow
Solution 8 - IosAkshay PagareView Answer on Stackoverflow
Solution 9 - IosDaniel DanieleckiView Answer on Stackoverflow