gradle-xcodePlugin icon indicating copy to clipboard operation
gradle-xcodePlugin copied to clipboard

Plugin breaks when installed with Android Gradle Plugin Alpha-07 / Android Studio Canary 7

Open chris-hatton opened this issue 4 years ago • 0 comments

After upgrading Android Studio from 2020.3.1 Canary 6 to Canary 7, the Xcode plugin 'broke' - with IDE Gradle Sync failing on an OkHttp API that is incompatible with Kotlin Companion objects.

Ultimately this appears to be because the version of OkHttp used by the Xcode plugin is too old. I was able to work around this by replacing the dependency with a later OkHttp3 based one (and was lucky enough that the API is still compatible), here:

In top-level build.gradle:

buildscript {
    repositories { ... }
    dependencies { ... }
    configurations.all {
        resolutionStrategy.eachDependency {
            if (requested.group == "com.squareup.okhttp" && requested.name == "okhttp") {
                useTarget("com.squareup.okhttp3:okhttp:4.9.1")
            }
        }
    }
}

This workaround may help similarly affected users. Suggest the Xcode plugin project updates the dependency.

chris-hatton avatar Feb 22 '21 07:02 chris-hatton