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

Joe Rakhimov

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?

AllinProgram

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.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

make main thread wait for other threads to finish

In c, how to make a thread wait for other threads to finish

Wait for UI thread to finish

Java Wait for thread to finish

How to wait for a reflection thread to finish

How NOT to wait for a thread to finish in Python

Swift wait for closure thread to finish

In Kotlin, will a Handler thread wait another thread finish?

Multi-threaded matrix multiplication in the main thread doesn't wait until the other threads finish their work?

How to wait for thread pool to finish all tasks?

Java: create x amount of thread, and then wait for then to finish

How can I wait for a thread to finish with .NET?

How to wait for the function finish (Threads in Thread)

Python: How to NOT wait for a thread to finish to carry on?

Wait for threads to finish before creating a new thread

MariaDB make SELECT wait for other transactions to finish

NodeJS: Wait for all foreach with Promises to finish but never actually finishes

How to wait for a thread to finish before another thread starts in Java/Android?

C# Need to wait for thread to finish without blocking UI thread

Wait for callback from other thread

Main thread wait for other threads

Thread.Sleep and Task.Delay randomly hanging and never ends

Wait for then() to finish

How to wait for main Thread until asynchronous methods will finish?

Event handler seems to finish always after the main thread wait loop

How do I wait for all threads in an Indy thread pool to finish

Why does main thread wait for background threads to finish

Why pthread_join does not block and wait for the thread to finish?

Make the main thread wait until all threads finish