Android初学:Gradle 'HelloWorld' project refresh failed


Gradle 'HelloWorld' project refresh failed

Error:Failed to open zip file.
Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
<a href="syncProject">Re-download dependencies and sync project (requires network)</a>
<a href="syncProject">Re-download dependencies and sync project (requires network)</a>

出现这种情况时,

解决方法一: 清除缓存, 重启Gradle, File->Invalidate Caches / Restart... ; 即可;

解决方法二:file ->settings->Build Tools ->Gradle 进行如下红框里的设置,即指定本地android studio里的Gradle路径。

 

解决方法三:从新下载一份Grandle的 gradle-X.X-all.zip(百度搜gradle下载进官网就行)版本,

 

 


再按照方法二来选择这个目录,就行了。

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM