Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cause: org.gradle.api.internal.initialization.DefaultClassLoaderScope@3f774d2b must be locked before it can be used to compute a classpath #2

Open
waseefakhtar opened this issue Jan 29, 2022 · 2 comments

Comments

@waseefakhtar
Copy link

Hi,

Does anyone experience this issue with Gradle when trying to run the project and have a solution?

Could not determine the dependencies of task ':app:mergeDebugAssets'.
> Could not resolve all dependencies for configuration ':app:debugRuntimeClasspath'.
   > A problem occurred configuring project ':onboarding:onboarding_presentation'.
      > org.gradle.api.internal.initialization.DefaultClassLoaderScope@3f774d2b must be locked before it can be used to compute a classpath!

I haven't tried other branches but I experience it so far with https://github.com/philipplackner/CalorieTracker/tree/Part2/Migrating_to_Gradle_Kotlin_DSL and with Android Studio 2020.3.1 and 2021.1.1. Any idea?

@waseefakhtar
Copy link
Author

In case anyone's experiencing this, I just found a solution using gradle/gradle#4823 (comment):

Disabling configureOnDemand in gradle.properties (Global Properties) helps fix it: org.gradle.configureondemand=false

@khemrajsharma
Copy link

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}")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants