简体   繁体   中英

Gradle: download gradle takes “very long time”, activity_main.xml keeps showing “Loading”

I have installed Android Studio today. I'm a newbie to Android development. I know that it has been asked several times, but my Android Studio is most updated as of now, so none of the solution seems to work. [AndroidStudio v3.6]

After the installation got over, I attempted to create an Empty Project. It opened the whole project as seen below,

在此处输入图像描述

After waiting for 7+ minutes (bottom-left), gradle is still not downloaded, and the activity_main.xml file keeps showing "Loading".

Solution 1 - Change the gradle location

I found this location to C:\Users\RAHUL.LAPTOP-DISIIAS2\.gradle\wrapper\dists\gradle-5.6.4-all\ankdp27end7byghfw1q2sw75f , but it contains two files - one is gradle-5.6.4-all.zip.part and other is gradle-5.6.4-all.zip.lck file.

Solution 2 - Invalidate and restart

Doesn't seem to work

Solution 3 - Change gradle settings to work in offline mode

The version I'm using doesn't have the option

在此处输入图像描述

How can I fix it?


Here is my gradle-wrapper.properties file:

在此处输入图像描述

First, check if you are connected to http\://services.gradle.org/distributions with ping command in Command Prompt. If you are connected, then change Proxy Settings in Android Studio to Use System Proxy . If it is downloading slowly again, your internet connection may be slow. Or you best fallow guidelines in this link: Gradle Download: Installing Manually

Then work in offline mode will appear in your settings.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM