Xcodebuild error "Unable to find a destination matching the provided destination specifier"

#1

Bitrise Build Issue Report template

Description of the issue

Hello, we have a problem with iOS build. We receive the error as if it could not find proper device:

xcodebuild: error: Unable to find a destination matching the provided destination specifier:
{ platform:iOS Simulator, OS:latest, name:iPhone 8 }
Available destinations for the “CI-Tests_iOS” scheme:
{ platform:macOS, arch:x86_64, id:420E1727-1771-77C5-658D-E41EAF10AE6C }

All details in log. Before build is triggered (using xcodebuild) we list all available devices, and seems like all needed devices are there. The problems started on 4th December. It was all working well before. On my local machine the build command works ok.
We’ve already enabled Enable Bitrise Support User for this app option.

Environment:

Where did the issue happen?

Bitrise Xcode 11.1, Mac OS 10.14.6

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

Script

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
  • Does the issue happen sporadically, or every time? : Every time
  • Does upgrading the build Step to the latest version help? : NO
  • When did the issue start? : 4th December

Local reproduction

Locally it works fine.

Build log

  • xcodebuild build-for-testing -workspace DAZN.xcworkspace -scheme CI-Tests_iOS -destination ‘platform=iOS Simulator,name=iPhone 8’ -destination ‘platform=iOS Simulator,name=iPhone 8 Plus’ -destination ‘platform=iOS Simulator,name=iPad Pro (9.7-inch)’ -derivedDataPath ./build/iOS/ COMPILER_INDEX_STORE_ENABLE=NO
    ++ bundle exec xcpretty-json-formatter
  • XCPRETTY_JSON_FILE_OUTPUT=./build/iOS/build-ci-tests-ios.json
  • xcpretty -f /Users/vagrant/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/xcpretty-json-formatter-0.1.1/lib/json_formatter.rb
    xcodebuild: error: Unable to find a destination matching the provided destination specifier:
    { platform:iOS Simulator, OS:latest, name:iPhone 8 }

Available destinations for the “CI-Tests_iOS” scheme:

{ platform:macOS, arch:x86_64, id:420E1727-1771-77C5-658D-E41EAF10AE6C }

0 Likes

#2

Hi there @maciej.czupryna.dazn!

It seems that your project might be updated to a newer Xcode, but you are using Xcode 11 on our VM. Is this intended?
The solution could simply be to update the Xcode stack to a newer version :slight_smile:

0 Likes

#3

Hi, thank you for the response. Yes this was intended. However I’ve updated the stack to Xcode 11.3 and still no luck. I’ve received the same error.

0 Likes

#4

One more note, I’ve created new workflow with “Xcode build for simulator” plugin which is in Bitrise. I’m receiving the same error. Still not sure what is wrong, am I missing any step?
Log below:

+------------------------------------------------------------------------------+
| (0) xcode-build-for-simulator                                                |
+------------------------------------------------------------------------------+
| id: xcode-build-for-simulator                                                |
| version: 0.11.1                                                              |
| collection: https://github.com/bitrise-io/bitrise-steplib.git                |
| toolkit: go                                                                  |
| time: 2019-12-13T10:46:05Z                                                   |
+------------------------------------------------------------------------------+
|                                                                              |
INFO[10:46:05]  * [OK] Step dependency (xcode) installed, available. 
INFO[10:46:05]  * [OK] Step dependency (go) installed, available. 
Config:
- ProjectPath: DAZN.xcworkspace
- Scheme: CI-Tests_iOS
- Configuration: Release
- ArtifactName: 
- XcodebuildOptions: 
- Workdir: /Users/vagrant/git
- OutputDir: /Users/vagrant/deploy
- IsCleanBuild: true
- OutputTool: xcpretty
- SimulatorDevice: iPhone 8 Plus
- SimulatorOsVersion: latest
- SimulatorPlatform: iOS
- DisableIndexWhileBuilding: true
- VerboseLog: true
- CacheLevel: swift_packages
Step determined configs:
- xcodebuildVersion: Xcode 11.3 (Build version 11C29)
Checking if output tool (xcpretty) is installed
- xcprettyVersion: 0.3.0
Simulator info
Latest simulator for iPhone 8 Plus = CB40CADF-1FE8-47B6-9C56-1B1D2EC2A1D9
Running build
[10:46:13] $ set -o pipefail && xcodebuild "-workspace" "/Users/vagrant/git/DAZN.xcworkspace" "-scheme" "CI-Tests_iOS" "-configuration" "Release" "CODE_SIGNING_ALLOWED=NO" "-destination" "id=CB40CADF-1FE8-47B6-9C56-1B1D2EC2A1D9" "COMPILER_INDEX_STORE_ENABLE=NO" "clean" "build" | xcpretty
Last lines of the Xcode's build log:
Build settings from command line:
    CODE_SIGNING_ALLOWED = NO
    COMPILER_INDEX_STORE_ENABLE = NO
xcodebuild: error: Unable to find a destination matching the provided destination specifier:
		{ id:CB40CADF-1FE8-47B6-9C56-1B1D2EC2A1D9 }
	Available destinations for the "CI-Tests_iOS" scheme:
		{ platform:macOS, arch:x86_64, id:420E1727-1771-77C5-658D-E41EAF10AE6C }
You can find the last couple of lines of Xcode's build log above, but the full log is also available in the raw-xcodebuild-output.log
The log file is stored in $BITRISE_DEPLOY_DIR, and its full path is available in the $BITRISE_XCODE_RAW_RESULT_TEXT_PATH environment variable
(value: /Users/vagrant/deploy/raw-xcodebuild-output.log)
Build failed, error: exit status 70
0 Likes

#5

Hi @maciej.czupryna.dazn!

Sorry for the delay. Did this latest build occur on the Xcode 11.3 stack? Can you please send us a URL for it?

0 Likes