我已经安装了新的Android Studio。一切都工作得很好,但当我试图创建一个新项目时,它在下载Gradle时卡住了。
有没有办法手动安装Android Studio所需的Gradle ?或者有其他方法可以解决这个问题吗?
我已经安装了新的Android Studio。一切都工作得很好,但当我试图创建一个新项目时,它在下载Gradle时卡住了。
有没有办法手动安装Android Studio所需的Gradle ?或者有其他方法可以解决这个问题吗?
当前回答
打开gradle-wrapper.properties 改变: distributionUrl = https /: / / services.gradle.org/distributions/gradle all.zip——4.4 : - 4.4 - all.zip distributionUrl = http://services.gradle.org/distributions/gradle
注意: 1. 我不关心SSL禁用下载gradle,但其他人可能是敏感的,所以这取决于你。 2. 注意gradle版本,在我的例子中是4.4。
其他回答
这对我来说也花了很长时间(连接慢)。
在Ubuntu(16.04)上,我可以通过查看以下内容来监控下载进度:
~/.gradle/wrapper/dists/gradle-3.3-all/55gk2rcmfc6p2dg9u9ohc3hw9/
在此目录下运行ls -al会显示gradle-3.3-all.zip文件。部分文件继续增长。
文件最终是88M。
请注意55gk2rcmfc6p2dg9u9ohc3hw9(和gradle版本)可能不同,请相应地更改您的命令。
我通过删除.gradle文件夹解决了这个问题
在windows中: C:\Users{已登录用户}.gradle
Android Studio自带Gradle,但它没有命令行Gradle功能。
是的,有。
Create a new project and you should Shutdown The Android Studio Application.(Because it takes a long time for you). Goto C:\Users\{Logged in User}\.gradle folder There is a folder there that show you which version of gradle Android Studio requires (e.g. gradle-1.8-bin) Download this version from internet (e.g. gradle-1.8-bin.zip). Goto C:\Users\{Logged in User}\.gradle\wrapper\dists\gradle-1.8-bin There is a folder here that its name is like a GUID. You should just copy the zip file that you've already downloaded from internet into this folder. Execute Android Studio and create a new project.
是的,你可以在Android Studio之前手动安装Gradle,首先将Gradle安装在任何位置,然后将de gladle位置添加到路径变量(在环境变量窗口中)。