Manoj Pantha
Manoj Pantha

Reputation: 81

Gradle project sync failed in android studio while developing app

Error:Unable to find method 'com.android.build.gradle.tasks.factory.AndroidJavaCompile.setDependencyCacheDir(Ljava/io/File;)V'.

Possible causes for this unexpected error include:

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

Upvotes: 8

Views: 8045

Answers (1)

Md Sufi Khan
Md Sufi Khan

Reputation: 1761

Though its late but I am posting this solution (worked for me) to help if someone get same error.

I built a project on android-studio 3.0.1 and the gradle value was gradle-4.1-all.zip. But when I tried to build same project on android-studio 2.2.3 I got this error. As my gradle version is gradle-2.14.1-all.zip

So by changing distributionUrl property in gradle-wrapper.properties file fixed this error for me.

Upvotes: 10

Related Questions