gradle issues details in discription

Viewed 12758

Unable to find method 'org.gradle.api.artifacts.result.ComponentSelectionReason.getDescription()Ljava/lang/String;'. Possible causes for this unexpected error include: Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.) Re-download dependencies and sync project (requires network)

The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem. Stop Gradle build processes (requires restart)

Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.

In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.

7 Answers

I resolved the error by downgrading gradle. To do so, in the gradle-wrapper.properties file, I made the following changes.

It was:

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

It is now:

distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-all.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME

If you are using IntelliJ Community Edition, upgrading the IDE to IntelliJ IDEA 2021.1.2 (Community Edition) solved the problem for me. Previously I was using the 2019 version and I was getting the same error.

I had the same problem. I solved it, when I update Android Studio with Gradle.

Upgrading IntelliJ version from 2019 to 2021 fixed the issue for me

org.gradle.internal.exceptions.LocationAwareException: 'java.lang.String org.gradle.api.tasks.SourceSet.getCompileConfigurationName()'

Caused by: java.lang.NoSuchMethodError: 'java.lang.String org.gradle.api.tasks.SourceSet.getCompileConfigurationName()'

I got the same error mentioned in the question with the above exceptions.

As mentioned above, upgrading the intellij version from from 2019 to 2021 helped me.

Upgrading Intellij version worked.

Either upgrade or downgrade your IntelliJ idea. Stupid but that's the way to go. I jumped between 2021.3.2, 2019.3.1, 2021.1.2 and some version of 2022 however, downgrading to 2021.1.3 fixed my issue. It all started after I changed my hdd and downloaded the latest version intellij idea.

Related