问题
I am currently using the kotlin-dsl Gradle plugin 0.18.2, Kotlin 1.2.51 and Gradle 4.10.2 in my Android project (take a look at the temporary project-setup
branch).
I like to migrate to Kotlin 1.3. However, I have difficulties in finding out which combination of version works. I raised the dependencies to their latest version:
// in build.gradle.kts:
id("org.gradle.kotlin.kotlin-dsl") version "1.0.4"
...
// in build.gradle:
org.jetbrains.kotlin:kotlin-stdlib:1.3.10
As soon as I run a Gradle task it fails with the following error:
WARNING: Unsupported Kotlin plugin version. The
embedded-kotlin
andkotlin-dsl
plugins rely on features of Kotlin1.2.61
that might work differently than in the requested version1.3.10
.
Is there a migration guide besides what is written in the release notes of the kotlin-dsl Gradle plugin?
Related
- kotlin-dsl issue #1269: Build failed with NoSuchMethodError: KotlinPluginWrapperKt.getKotlinPluginVersion
回答1:
The source of the migration problems was a misconfiguration of the buildSrc
folder. I was treating it as a module in the settings.gradle file:
include ':app', ':buildSrc', ':database', ':network'
Instead it should be treated as an included build as stated in the Gradle documentation.
The solution given by Paul Merlin, @eskatos was to simply remove the buildSrc
folder there:
include ':app', ':database', ':network'
来源:https://stackoverflow.com/questions/53558142/how-to-migrate-from-kotlin-1-2-to-1-3-with-the-kotlin-dsl-gradle-plugin