1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > 导入android studio项目 编译失败

导入android studio项目 编译失败

时间:2018-10-16 17:42:36

相关推荐

导入android studio项目 编译失败

使用android studio 打开studio 工程,编译的时候报错:

INFO - .project.GradleProjectResolver - Gradle project resolve error

org.gradle.tooling.GradleConnectionException: Could not install Gradle distribution from '/distributions/gradle-2.10-all.zip'.

电脑本身已经开了vpn ,但是每次编译的时候都报这错误,后来参考网上的解决方法,已经解决该错误,现在备注一下。

虽然已经开了vpn,为什么会报错?

个人感觉应该是在~/.gradle/wrapper/dists/ 目录下有之前我不知道从那下载的 gradle-2.10-all.zip 包 (可能包有问题,所以一直装不上),因为gradl检测到已经有安装包了,所以没有从网上去重新下载它需要的那个包,所以即使开了vpn跟没开一样。

后来我就把 那个目录下的包都给删除了,gradle 应该是从那个网址上重新下载的正确的包进行的安装。所以错误消失了。日!

下面是网上找到的方法:

1:

It could be that the gradle-2.1 distribution specified by the wrapper was not downloaded properly. This was the root cause of the same problem in my environment.

Look into this directory:

ls -l ~/.gradle/wrapper/dists/

In there you should find a gradle-2.1 folder. Delete it like so:

rm -rf .gradle/wrapper/dists/gradle-2.1-bin/

Restart IntelliJ after that and it will restart the download from the beginning and hopefully work.

原帖地址:/questions/27467155/could-not-install-gradle-distribution-from-https-services-gradle-org-distribu

2:

1、Failed to import new Gradle project: Could not install Gradle distribution from'/distributions/gradle-1.6-bin.zip'.

问题原因:中国连接gradle的地址被强了

解决方案:修改android studio设置Http Proxy->Auto-detect proxy settings

地址:/fourw/p/3198012.html

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。