Project does not contain a scheme

Bitrise Build Issue Report template

Description of the issue

This is the first time I use Bitrise and online CI. I’ll try to explain.
I got an iOS project which includes Cocoapods with multiple targets.
When I want to build with XCode on my Mac, everything is fine. When I try with Bitrise, it stops arriving at the xcodebuild step when choosing the scheme. It says that the scheme doesn’t exist. I tried to you the command xcodebuild -project “MyProjectName” -list and I see the scheme I want to build.

Environment:

Where did the issue happen?

_If on Bitrise.io: which stack? If not on Bitrise.io: on what operating system? On Bitrise.io with the Xcode 8.2.x on macOS 10.12. Same problem on Xcode 8.0.x on macOS 10.11. I tried with the CLI on my Mac, but it crashes later (I explain in the answer about the Bitrise CLI).

Which build Step causes the issue and which version of the step? xcodebuild, latest version

Reproducibility

  • Does a “Rebuild” help? (You can trigger a rebuild from the Build’s page, by clicking the “Rebuild” button in the top right corner of a finished build) : NO
  • Does a rebuild without caches help? (You can remove the Cache:Pull and Cache:Push steps temporarily to not to use the cache, or you can delete all the caches on the Settings tab of the app. : NO
  • If you have multiple different build configurations (workflows), does the issue affect all/more than one? : NO (I got one workflow)
  • If it’s an issue which happens sporadically, what’s the frequency? (e.g. Once a day ; about x% of the builds) :
  • Does upgrading the build Step to the latest version help? : NO
  • When did the issue start? : build #7, today @15:11

Other stacks

Can it be reproduced by running the build locally with our CLI ( https://www.bitrise.io/cli ), after doing a new git clone of the repository into the /tmp directory and running the build from there with the Bitrise CLI ( https://www.bitrise.io/cli )?
Yes and No. Yes it may be start the build with the environment and No because it says that a variable is missing.

Build log

Please attach the build log (you can download the build log from the build’s page, once the build is finished, using the “Download log” button - floating at the bottom right corner of the log viewer), or if you can’t attach the whole log then send the full log through a private channel (e.g. email - https://www.bitrise.io/contact ), with a link to the related GitHub issue.
I send the log via mail

Hi,

Can you please try this after a clean git clone of the repository (into a new directory)? I believe you’ll get the same result after the clean git clone as what you see on Bitrise, that the scheme does not exist in the repository.

Please make sure that the scheme is shared and committed into your repository, otherwise the scheme only exists on your Mac, and is auto created on other Macs when the project is opened in Xcode.app, but not if you build it with the Xcode command line tools (xcodebuild).

1 Like

Hi,

I tried to clone the repo in a new directory.
The xcodebuild command gave me the same result as I saw earlier: it lists all my schemes.
So, my schemes are well shared and committed in my repository.
I saw your link previously and checked if everything was ok.

Are you sure that you opened the same Xcode project?

Also, did you run the xcodebuild ... -list command right after the git clone, without opening the project in Xcode.app? (If you open the project in Xcode.app it can auto generate user schemes, but xcodebuild does not)

Just noticed one more thing: you have a CocoaPods Install step in your workflow, so you most likely use CocoaPods, but the project specified for the Xcode Archive step is not the workspace but the project.

If you use CocoaPods you have to use the .xcworkspace, and not the .xcodeproj project file. This is usually set as an App Env Var in the workflow, for the key BITRISE_PROJECT_PATH - just change the value of this env var to the .xcworkspace if it’s a .xcodeproj (don’t change the key, it have to be BITRISE_PROJECT_PATH regardless of whether the value is a project or workspace)

Hi Viktor,

Thanks for the tips, I didn’t know where I could change the value. It test and I’ll let you know the result.
For your information, the command to list schemes was indeed executed after a clean git clone without opening the project in xcode.

1 Like

So, I just tested with setting the .xcworkspace in the app var. I got the same result:
The workspace named “…” does not contain a scheme named “…”.
However in the log about Cocoapods, I clearly see the scheme name.
I send you the latest log via mail.

Erwan

Ahh, just noticed something: you used the cocoapods-and-repository-validator step in your workflow.

Please replace this step with the “CocoaPods Install” step!

I’m not sure why this cocoapods-and-repository-validator step is not deprecated yet, but it definitely should be, please do not use it!

Ok, I’ll try with it.

Thanks

1 Like

SO, I changed the step to Cocoapods Install. It works now. The build starts. Now I got a problem with a Pod, I think.
It’s bit weird, it starts building a Pod, and it stops with no error message. I’ll try with another stack to see if I got the same problem.

Hey Viktor,

It’s ok now. The main problem was in fact that my workflow was using the xcproject instead of xcworkspace. In the architecture of the app, we have our pods in the git. So the Cocoapods was not needed. Including this step gave me a problem because in a pod we had modified some project properties.
Finally, I use the stack Xcode 8.2.x on macOS 10.12 and it works.

Thanks a lot for your help,

Erwan

1 Like

Glad to hear that you managed to solve it and thank you for sharing the solution! I’m sure it will help others in the future :wink: