Android studio导入项目时的问题(Re-download dependencies and sync project (requires network))

来源:互联网 发布:linux版本查看 编辑:程序博客网 时间:2024/04/26 07:11

刚导入项目是报。Error:Failed to open zip file.
Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
Re-download dependencies and sync project (requires network)
Re-download dependencies and sync project (requires network)

原因是和项目中gradle版本不同

解决方法是

项目中gradle   gradle-wrapper.properties,

distributionUrl=https\://services.gradle.org/distributions/gradle-3.3.zip

将红色部分改为自己的版本,或者下载相应的版本,在build一下,就可以。



再次导入项目的时候,可能出现

Error:Cause: https://downloads.gradle.org/distributions/gradle-3.3.zip


解决:

setting——Build,Execution,Deployment——Gradle——use local gradle distrbutton,选择一下gradle-3.3.zip下载的位置,apply——ok就行了





阅读全文
0 0
原创粉丝点击