Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle Sync: Wait for the other thread to finish acquiring the distribution never ends

Created new Android Studio project. But Gradle Sync never ends:

Gradle Sync: Wait for the other thread to finish acquiring the distribution

I have checked Android Studio does not download data:

enter image description here

enter image description here

I have checked internet connection, it is working but it is slow.

enter image description here

Is this because of a slow internet connection? If no, how to solve this problem?

like image 319
Joe Rakhimov Avatar asked May 13 '19 07:05

Joe Rakhimov


People also ask

How long does gradle download take?

Gradle download in Android takes forever. The download is about 50MB, but Android Studio is still busy - 3 hours!!

How do I fix design editor is unavailable until next gradle sync?

Just you have to do >> open File --> Sync Project with Gradle Files and then after >> open File --> invalidate Android Studio caches / restart so done this problem.:) Show activity on this post.


1 Answers

I also met this problem. Then I found out that this is due to the gradle of the project dependency is not downloaded.

Ways to verify the problem:

Check if there is a gradle file in the directory.

Linux:~/.gradle/wrapper/dists

Windows:C:\users\{user name}\.gradle\wrapper\dists

If the file does not exist in the directory, Then this is what led.

Ways to resolve the problem:

wo need to download the configuration file manually.

  1. Download the file(gradle) form https://services.gradle.org/distributions/ according to the distributionUrl in the gradle-wrapper.properties, infact You can modify it according to your needs.

    For example, in my gradle-wrapper.properties, distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip. So I should download the filegradle-5.1.1-all.zip

  2. move the file(gradle-5.1.1-all.zip) you downloaded to the deepest part of above directory.

    For example, in my pc, its final position is C:\Users\ufan0\.gradle\wrapper\dists\gradle-5.1.1-all\97z1ksx6lirer3kbvdnh7jtjg.

    note: There will be undownloaded files in C:\Users\ufan0\.gradle\wrapper\dists\gradle-5.1.1-all\97z1ksx6lirer3kbvdnh7jtjg when you check there first, you can delete them, then move the zip of gradle to there.

  3. Now you can restart the Android Studio, then choose File -> Sync Project With Gradle Files.

When these are all done, The Android Studio should be able to work properly.

note: In order to avoid this type of situation the next time, you can choose to configure the Setting -> Gradle -> Use local gradle distribution.

like image 76
AllinProgram Avatar answered Nov 15 '22 00:11

AllinProgram