openbakery / gradle-xcodePlugin

gradle plugin for building Xcode Projects for iOS, watchOS, macOS or tvOS
Apache License 2.0
458 stars 130 forks source link

Gradle build error: No matching simulators found #326

Closed adil-hussain-84 closed 7 years ago

adil-hussain-84 commented 7 years ago

I just tried bumping up the Gradle Xcode plugin from version 0.14.2 to 0.14.4 in my project with no other changes in my bulid.gradle file and I'm getting the following Gradle build error:

No matching simulators found!

This is what my bulid.gradle file looks like (with all the unrelated bits stripped off):

plugins {
    id 'org.openbakery.xcode-plugin' version '0.14.4'
}

xcodebuild {
    destination {
        platform = 'iOS Simulator'
        name = 'iPhone 6'
        os = '9.3'
    }
}

If I drop the Gradle Xcode plugin back down to 0.14.2 the Gradle build works. If I keep the Gradle Xcode plugin version to 0.14.4 and specify the os as 10.1 the Gradle build works.

(Unfortunately I cannot keep the os to 10.1 in my build.gradle file because I have unit tests in my project that fail because of an Xcode issue with the latest iOS release.)

renep commented 7 years ago

Do you use the new Xcode 8.2?

adil-hussain-84 commented 7 years ago

Downloading Xcode 8.2 now. Will try this again later today.

adil-hussain-84 commented 7 years ago

Unfortunately this is still failing with Xcode 8.2. The Gradle build fails with No matching simulators found error message when I set os = '9.3' (and the build fails also for os level lower than 9.3). This is the info message I see in the output:

No matching simulators found for specified destinations: [Destination{platform='iOS Simulator', name='iPhone 6', arch='null', id='null', os='9.3'}]

In the list of available simulators on my machine I see this:

-- iOS 9.3 --
    ...
    iPhone 6 (DCF7E667-92F9-4E41-A330-E94B747851B2) (Shutdown)
    ....

I have tried explicitly setting arch and id as well in the build.gradle file but that makes no difference. The build still fails.

renep commented 7 years ago

Have you tried to set only the ID?

Does is work with Xcode using the 9.3 simulator?

Try to run gradle simList so see what simulator gradle finds.

Doxxer commented 7 years ago

Have the same error: XCode 8.2, trying iPhone 6 (9.3) simulator.

gradle simList contains this simulator:

-- iOS Simulator 9.3 --
...
         iPhone 6 (2021C13F-9809-4438-98E2-A99603909CD2)
...

It works with XCode with iPhone 6 (9.3) simulator

Doxxer commented 7 years ago

@renep what is the reason of 2nd parameter in this function?

I think, there should be just return simulatorControl.getAllDestinations(parameters.type), without restriction to getMostRecentRuntime. With parameter it collects simulator only from latest runtime (10.2).

renep commented 7 years ago

Implemented, so please test the latest develop version.

Doxxer commented 7 years ago

It works with xcode-plugin version 0.14.5.develop.80