Kotlin-dsl-samples: Gradle 4.10-rc1 can't resolve dependency kotlin-scripting-compiler-embeddable

Created on 13 Aug 2018  路  9Comments  路  Source: gradle/kotlin-dsl-samples

After upgrade to Gradle 4.10-rc1 i faced with this problem while gradle sync:

Execution failed for task ':buildSrc:compileKotlin'.
> Could not resolve all files for configuration ':buildSrc:kotlinCompilerPluginClasspath'.
   > Could not find org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:1.2.60.
     Searched in the following locations: file:/Users/ivan.balaksha/.gradle/caches/4.10-rc-1/embedded-kotlin-repo-1.2.60-2/repo/org/jetbrains/kotlin/kotlin-scripting-compiler-embeddable/1.2.60/kotlin-scripting-compiler-embeddable-1.2.60.jar
     Required by:
         project :buildSrc
   > Could not find org.jetbrains.kotlin:kotlin-sam-with-receiver:1.2.60.
     Required by:
         project :buildSrc

Link to demo project: https://github.com/Malinskiy/marathon/pull/84

Most helpful comment

With Kotlin 1.2.60, the Kotlin Gradle Plugin driving the kotlin compiler requires extra dependencies that aren't required by Gradle Kotlin DSL scripts alone and aren't embedded into Gradle.

This can be fixed by adding a repository that contains Kotlin compiler dependencies:

repositories {
    jcenter()
}

In your case it should go into ./buildSrc/build.gradle.kts

All 9 comments

With Kotlin 1.2.60, the Kotlin Gradle Plugin driving the kotlin compiler requires extra dependencies that aren't required by Gradle Kotlin DSL scripts alone and aren't embedded into Gradle.

This can be fixed by adding a repository that contains Kotlin compiler dependencies:

repositories {
    jcenter()
}

In your case it should go into ./buildSrc/build.gradle.kts

@eskatos thank you. Solved.

I think this should be added to release notes. I've just wasted half an hour on troubleshooting and then found this issue.

Thanks, @eskatos
I seem to have missed this part when reading about upgrading to Gradle 4.10

With Kotlin 1.2.60, the Kotlin Gradle Plugin driving the kotlin compiler requires extra dependencies that aren't required by Gradle Kotlin DSL scripts alone and aren't embedded into Gradle.

This can be fixed by adding a repository that contains Kotlin compiler dependencies:

repositories {
    jcenter()
}

In your case it should go into ./buildSrc/build.gradle.kts

big big big help!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

cool thanks a lot!

Thank you very much @eskatos. Please write it down in the documentation.

@jcornaz it is documented here https://docs.gradle.org/current/userguide/kotlin_dsl.html#sec:kotlin-dsl_plugin

With Kotlin 1.2.60, the Kotlin Gradle Plugin driving the kotlin compiler requires extra dependencies that aren't required by Gradle Kotlin DSL scripts alone and aren't embedded into Gradle.

This can be fixed by adding a repository that contains Kotlin compiler dependencies:

repositories {
    jcenter()
}

In your case it should go into ./buildSrc/build.gradle.kts

I have added the line but still get the error

https://github.com/hereisderek/android-util/tree/f06b5b9b4ae859e61b8d27b7e099a12d770a5377

Was this page helpful?
0 / 5 - 0 ratings