1

there is a Gradle sync error message that has been plaguing two of my coworkers’ Android Studios. They are both running macOS and the latest Android Studio.

Gradle sync fails with this error every time:
12:06 PM Gradle sync failed: Could not install Gradle distribution from 'https://services.gradle.org/distributions/gradle-7.2-bin.zip'. (3 m 41 s 707 ms)

12:06 PM Project [project-name] is using the following JDK location when running Gradle:
/Applications/Android Studio.app/Contents/jre/Contents/Home
Using different JDK locations on different processes might cause Gradle to
spawn multiple daemons, for example, by executing Gradle tasks from a terminal
while using Android Studio.
More info...
Select a JDK
Do not show this warning again

The Gradle ZIP file downloads successfully, but after unpacking, they always end up with that error.

I’ve had them try a bunch of things including:

  • Uninstalling SDKMAN
  • Changing the Gradle JDK to “Android Studio default JDK” and other options
  • Reinstalling Android Studio
  • Running “Invalidate Caches…”
  • Deleting the .gradle folders from both the project root and the macOS user folder

Nothing we’ve tried seems to fix it. At our work, we have some really obnoxious network filtering software that has caused problems for us trying to download dependencies, but it’s working on my computer, and not on theirs. I’m running out of ideas…

Eugene
  • 3,417
  • 5
  • 25
  • 49
  • I also meet the same problem. and can not solve it. The above answer is not in Android studio. do you have found a solution. @Eugene. – Wang Jijun Aug 21 '22 at 16:38

1 Answers1

0

I received this response elsewhere that my coworker said fixed this issue on their Mac:

Try and remove the gradle wrapper and installing the gradle wrapper again. Also the wrapper can be changed from bin to all and that might help as well. It would be something like this

distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-all.zip

i use sdkman to install gradle for the cli and then use something like this

gradle wrapper --gradle-version 7.4.2 --distribution-type all
Eugene
  • 3,417
  • 5
  • 25
  • 49
  • I find it hard to see any relation and "all" just has the sources, too. Not required unless writing Gradle plugins. – Martin Zeitler May 19 '22 at 01:35
  • I would like to provide one more solution, a solution that I have not seen on the web and that is the path for gradle home. I was looking through the settings and came across this: Go to **File >> Settings** Then scroll down to **Build, Execution, Deployment > Build Tools > Gradle** Finally check out the value of the Gradle user home, is it valid? If not navigate to the appropriate path and resync project. – user1124937 Jul 09 '22 at 12:07
  • Could not install Gradle distribution from 'https://services.gradle.org/distributions/gradle-7.2-bin.zip'. – CS QGB May 06 '23 at 22:16