Igor Wojda
09/09/2022, 9:34 PMjava.lang.IllegalArgumentException: org.gradle.api.internal.initialization.DefaultClassLoaderScope@1563e239 must be locked before it can be used to compute a classpath!
Config
//buuld.gradle.kts
plugins {
id("com.android.application") apply false
id("com.android.library") apply false
id("org.jetbrains.kotlin.android") apply false // or kotlin("android")
}
By looking at open-source projects I have found a way of fixing this issue by using buildSrc
and adding adding explicit plugin import into implementation
sourceset:
builddSrc/build.gradle.kts
plugins {
`kotlin-dsl`
}
repositories {
google()
mavenCentral()
}
dependencies {
implementation("com.android.tools.build:gradle:7.2.2")
}
However I don't understand why this error occurs and why this fix works 🤔 also is there any better way of fixing it?