64

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

1
  • how to locate the schema from this message. I am getting exactly this message.[ xcodebuild: error: The workspace named "jamesAppV2" does not contain a scheme named "". The "-list" option can be used to find the names of the schemes in the workspace.] Commented Mar 11, 2016 at 12:47

11 Answers 11

67

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
Sign up to request clarification or add additional context in comments.

5 Comments

@M.Y.The first line of my answer already has a link for the source. In fact the text from his answer is highlighted, to explicitly that is quoted.
how to locate the schema from this message. I am getting exactly this message.[ xcodebuild: error: The workspace named "jamesAppV2" does not contain a scheme named "". The "-list" option can be used to find the names of the schemes in the workspace.]
I am getting the same error , even after following all the steps :(
@QadirHussain did you find any solution on your problem? I am getting same issue ..
react native peeps follow this one: stackoverflow.com/a/57286808/6363952
34

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

3 Comments

Yes! That worked! I had all the settings correct, but it just wouldn't work before.
The selected answer didn't work for this issue occurred with using react native cli, but this one (removing .xcworkspace file) worked like a charm!
Thanks! I use ReactNative, was playing around with additional deps that required cocoapods, but afterwards decided to revert and don't use them. And seems like .xcworkspace was created and didn't show up as changes in git.
19

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

2 Comments

this solution worked for me, it was occurred after I renamed my project,..thanks
I don't see a xcshareddata folder
8

You can follow the instruction as in the image below.

enter image description here

Comments

7

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

Comments

4

Open your Xcode and follow the steps

  1. Open your project.xcworkspace file in xcode or open ios folder in Xcode if you are using react native.
  2. Go to Product > Schemes > Manage Schemes
  3. In the list select your project
  4. Select Edit > duplicate scheme and rename with the name of your project you just changed or what is it.
  5. Close the window, again go to Product > Schemes > Manage Schemes
  6. This time select the project and select - option near to the edit button

it will remove your old workspace file and you'll have the new file only.

Comments

1

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!

Comments

0

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.

Comments

0

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

Comments

0

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

Comments

0

Check the casing of the scheme you've specified. In my case, I'm building the IPA as part of an Azure DevOps pipeline. Here is my step yaml:

- task: Xcode@5
  displayName: "Build IPA"
  inputs:
    actions: "build"
    configuration: "Release"
    sdk: "iphoneos"
    xcWorkspacePath: "ios/casesensitivename.xcworkspace"
    scheme: "CaseSensitiveName"
    packageApp: true
    exportPath: "output"
    signingOption: "manual"
    signingIdentity: "$(APPLE_CERTIFICATE_SIGNING_IDENTITY)"
    provisioningProfileUuid: "$(APPLE_PROV_PROFILE_UUID)"

I originally had the scheme set to "casesensitivename" which caused my error. Updating it to "CaseSensitiveName" fixed the issue.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.