Reputation: 131
I'm starting a project using the KorGE library, and I would like to use Retrofit as XML parser. So I try to follow this guide, which seems fine, but I just poorly get stuck by adding the dependencies in the first step.
I already have the KorGE libraries included (I started from the template):
dependencies {
classpath("com.soywiz.korlibs.korge.plugins:korge-gradle-plugin:$korgePluginVersion")
classpath("com.soywiz.korlibs.klock:klock:1.6.1")
}
But when I try to includes the following dependencies, everything turns to hell when I load gradle changes (I guess this is the way I should declare them?):
classpath("com.squareup.retrofit:retrofit:2.4.0")
classpath("com.squareup.retrofit:converter-simplexml:2.4.0")
In the guide it seems that this dependencies are part of APIs, but I did not found anything different about declaration on the net. If I just copy-past it obviously doesn't work.
The errors I get after loading gradle changes:
java.lang.IllegalArgumentException: org.gradle.api.internal.initialization.DefaultClassLoaderScope@a2e5ac5 must be locked before it can be used to compute a classpath!
java.lang.IllegalArgumentException: project.classLoaderScope must be locked before querying the project schema
Thank you very much in advance for your help guys, and sorry for my noobiness.
Upvotes: 13
Views: 9139
Reputation: 59004
Solution worked for me 👇
I was also facing this issue, and I didn't find a solution. This below solution worked for me.
🪲Cause:
I was using kotlin build.gradle. And I was using below
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}")
Where kotlinVersion
was in another class & it was imported like
import DependenciesVersions.kotlinVersion
Which was causing issue.
🔎Solution:
Remove import line from build.gradle.kts
Use your version like this
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${DependenciesVersions.kotlinVersion}")
And now sync project, it will work.
Upvotes: -1
Reputation: 61
Removing org.gradle.configureondemand=true
in ~/.gradle/gradle.properties solved it for me.
Upvotes: 6