Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle's dependency cache may be corrupt

I already tried to Invalidate/Cache and restart

also tried to remove .gradle and gradle file.. but this problem still shows up.

Error:Unable to find method 'com.android.build.gradle.BaseExtension.getTestVariants()Lorg/gradle/api/internal/DefaultDomainObjectSet;'. 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.

Any thoughts?

Your help will be appreciated Thanks!

like image 559
Emmanuel Deiparine Avatar asked Sep 09 '15 06:09

Emmanuel Deiparine


People also ask

How do I fix gradle's dependency cache may be corrupt?

Just delete gradle folder , and let android studio download it again with click on Sync now !. Save this answer.


1 Answers

Try to reset the gradle to an older version which you can load correctly. Change the distributionUrl in gradle-wrapper.properties in gradle scripts. And this error can be solved.

like image 73
Zeng Travis Avatar answered Oct 13 '22 01:10

Zeng Travis