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

11

63

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

Accost answered 4/11, 2015 at 12:9 Comment(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.]Longhand
A
66

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
Accost answered 4/11, 2015 at 12:25 Comment(5)
@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.Accost
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.]Longhand
I am getting the same error , even after following all the steps :(Cyclopropane
@QadirHussain did you find any solution on your problem? I am getting same issue ..Khajeh
react native peeps follow this one: https://mcmap.net/q/136489/-error-failed-to-build-ios-project-we-ran-quot-xcodebuild-quot-command-but-it-exited-with-error-code-65Guerra
E
34

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

Epiphenomenon answered 15/2, 2018 at 13:25 Comment(3)
Yes! That worked! I had all the settings correct, but it just wouldn't work before.Pie
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!Canto
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.Undo
R
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
Retrieval answered 9/9, 2019 at 8:58 Comment(2)
this solution worked for me, it was occurred after I renamed my project,..thanksKazak
I don't see a xcshareddata folderOversize
A
8

You can follow the instruction as in the image below.

enter image description here

Amendatory answered 15/9, 2020 at 8:33 Comment(0)
L
5

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

Lefthanded answered 3/6, 2021 at 12:28 Comment(0)
S
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.

Soniferous answered 30/9, 2022 at 10:43 Comment(0)
R
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!

Regress answered 22/12, 2021 at 6:31 Comment(0)
B
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.

Brayton answered 3/10, 2019 at 16:11 Comment(0)
H
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
Hoar answered 23/9, 2021 at 13:48 Comment(0)
E
0

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

Euchology answered 11/4, 2022 at 12:11 Comment(0)
B
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.

Bedtime answered 21/2 at 14:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.