Android Gradle的依赖关系缓存可能已损坏,并且gradle构建不起作用 [英] Android Gradle's dependency cache may be corrupt and gradle build not working
问题描述
我试图导入这个项目,即使我也尝试导入其他几个项目,我得到了以下错误。
我已经花了5个小时,甚至在Google上尝试了很多解决方案,但没有任何解决方案能够帮助我。
我试过以下解决方案,没有任何工作。
1)delete .gradle目录
2)重新启动IDE,
3)我测试了com.android.tools.build:gradle-experimental:0.7.0-alpha1
我很沮丧因为这个Gradle和这些问题。
Gradle版本:Gradle-2.13,我不想改变这个版本。
Android Studio版本:稳定2.1.1
注意:我的其他项目是工作得很好,我也可以建立它。
谢谢
您可以针对此问题尝试不同的解决方法:
清洁项目和重建它。
$ b 2- 在导入项目,删除 Build 文件夹中的内容。 然后替换 gradle-wrapper.properties 文件,以使其使用本地发行版来构建项目:
distributionBase = GRADLE_USER_HOME
distributionPath = wrapper / dists
zipStoreBase = GRADLE_USER_HOME
zipStorePath = wrapper / dists
distributionUrl = file \:/opt/gradle/gradle-2.13-all。子p
其中,最后一行防止android studio下载或使用损坏的gradle缓存。
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.
Please help me if anybody faced the same problem.
Thanks
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.
这篇关于Android Gradle的依赖关系缓存可能已损坏,并且gradle构建不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!