If you have multiple Schemes in your Xcode Project or Workspace with the exact same name, Xcode will select one of these Schemes/Configurations randomly when building your project. This can result in random build success / failure, and if you check the raw Xcode output, you’ll see something like this:
xcodebuild: error: Scheme YOUR_DUPLICATED_SCHEME is not currently configured for the test action when it fails.
This can also happen if you use CocoaPods and one of your Pods have the same name as your project.
To debug this, list the available Schemes with Xcode’s command line tool. In your project’s directory, run:
xcodebuild -workspace ./path/to/workspace/file -list
If you use a project file instead of a workspace file, run this:
xcodebuild -project ./path/to/project/file -list
There should be no duplicated Scheme in the printed list. To run this command on bitrise.io, add it to a Script Step. Compare the results after running it both on your computer and on bitrise.io: the lists should be identical.