I am experiencing the crash ```java.lang.IllegalAr...
# android
i
I am experiencing the crash
Copy code
java.lang.IllegalArgumentException: org.gradle.api.internal.initialization.DefaultClassLoaderScope@1563e239 must be locked before it can be used to compute a classpath!
Config
Copy code
//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:
Copy code
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?