I am trying to import this project, even I tried to import other few projects too, I am getting below error.
https://github.com/ashdavies/data-binding
I have spent my 5 hours on it, even I tried many solutions on google but nothing gonna worked for me.
I tried following solutions, nothing worked.
1) delete .gradle directory
2) Restart IDE,
3) I tested with com.android.tools.build:gradle-experimental:0.7.0-alpha1
I am frustrated because of this Gradle and these issues.
Gradle Version : Gradle-2.13, I do not want to change this version.
Android Studio Version : Stable 2.1.1
Note : My other project is working fine and I can build it too.
You can try different workarounds for this problem :
1- Clean project and Rebuild it.
2- Before importing the project, remove the contents of the Build folders.
Then replace the contents of your gradle-wrapper.properties file with the following lines, to make it use a local distribution for building the project :
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=file\:/opt/gradle/gradle-2.13-all.zip
in which, the last line prevents android studio to download or use a corrupted gradle cache.
Go to any browser
type gradle and press enter
you can specify any version you want after the
gradle keyword
i am downloading gradle 3.3
https://services.gradle.org/distributions click on this link which is in description directly if you want
click on gradle 3.3 all.zip
wait for the download to complete
c://user/your pc name /.gradle/wrapper/dists
wait till extraction it takes 5 mins to complete
Now open your project in android studio
9.go to file > settings >bulid ,exec,deployment > gradle
use local gradle distributn
select the location where you had extracted gradle 3.3.zip
C:\Users\your pc name.gradle\wrapper\dists\gradle-3.3
click on OK
Now build starts again and
you can see now the build is successful and error is resolved
or
watch tutorial https://www.youtube.com/watch?v=u92_73vfA8M
In my case, it was happening because i haven’t set the JDK path in environment variable. Please check from your Android studio studio that your JDK path is correct.
Go to Project Structure> SDK Location and check JDK Path. Give it the correct JDK path and also set the JAVA_HOME environment variable.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With