我已经安装了新的Android Studio。一切都工作得很好,但当我试图创建一个新项目时,它在下载Gradle时卡住了。

有没有办法手动安装Android Studio所需的Gradle ?或者有其他方法可以解决这个问题吗?


当前回答

Android Studio自带Gradle,但它没有命令行Gradle功能。

其他回答

快速修复:只要关闭你的防火墙,似乎android工作室想要下载一些东西,因为我们的防火墙阻止它下载它想要的文件,它就卡住了。

注意:关闭你的防火墙会降低你的安全性,如果你有时间,你可以允许android工作室在你的防火墙。通过这样做,你可以打开你的防火墙,同时允许android工作室下载任何它想要的东西。

使缓存无效并重新启动

这对我很管用。

是的,有。

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.

Gradle实际上包含在Android Studio中(至少在Mac OS X版本上)。我必须将其指向安装位置,在Android Studio应用程序的“包内容”(可以通过控制/右键单击应用程序图标来查看)。

是的,你可以在Android Studio之前手动安装Gradle,首先将Gradle安装在任何位置,然后将de gladle位置添加到路径变量(在环境变量窗口中)。