Home » Android » android – Gradle sync failed: The first result from the daemon was empty. Most likely the process died immediately after connection

android – Gradle sync failed: The first result from the daemon was empty. Most likely the process died immediately after connection

Posted by: admin May 14, 2020 Leave a comment

Questions:

I just recently downloaded an Android Studio and installed it on my PC. But When I try to set up my first project “hello world”, it always brings up the following:

Gradle sync failed: The first result from the daemon was empty. Most likely the process died immediately after connection.
Consult IDE log for more details (Help | Show Log)

How to&Answers:

I solved the problem by doing the following:

  1. go to C:/Users/.../.gradle/daemon/
  2. open any of the folders in daemon
  3. look for this file registry.bin.lock
  4. delete it
  5. now go sync the gradle in Android Studio and your problem will be solved

Success

Answer:

I was facing the same problem in Android Studio 3.However, none of the solutions mentioned here worked for me.With only 4 GB of RAM available ,the only thing worked for me was just changing the value specified for JVM args which is related to RAM in gradle.properties file like the following:

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.

org.gradle.jvmargs=-Xmx1536m

to:

org.gradle.jvmargs=-Xmx512m

then File | Invalidate Caches/Restart–> Invalidate and Restart

This really did the trick.

Answer:

Guess what, I just faced this issue and I solved it.
I did something very risky, but it looks like the fault is in the gradle cache directory.
If you are using windows the dir. will be at C:\Users\username…..gradle\caches and deamon <- will be the directory where all the gradle versions are stored. Delete the latest particular version from the Cache as well as the Deamon folder. Next time your project syncs, AS will automatically generate the two files.
Also
3.Now go to android studio – File ->invalidate Cache/Restart 4.Now edit gradle-wrapper.properties and add latest version of gradle there.After updation my gradle-wrapper.properties looked like this. From the above answer. This worked for me

Answer:

Today I faced the same issue. File-Invalidate & Restart worked for me.

Answer:

First Credit Goes to Kali Kimanzi ..
for this answer [Windows 7-10]

go to C:/Users/…/.gradle/daemon/
open any of the folders in daemon
look for this file registry.bin.lock
delete it
now go sync the gradle in Android Studio and your problem should be solved

A little update for noobs .. C:/Users//.gradle/daemon/
and instead of deleting the file registry.bin.lock just rename it to registry.bin.lock.backup just incase .. though the file itself might be corrupt

Answer:

Today i faced the same problem.I got a solution.Hope this will be helpful.

1.Just look gradle-wrapper.properties from project opened inside android studio.
distributionUrl=https://services.gradle.org/distributions/gradle-2.10-all.zip

2.Now to go C:\Users.gradle\wrapper\dists there you can see different gradle versions.Im my case i had a latest version gradle-2.11-all.

3.Now go to android studio – File ->invalidate Cache/Restart
4.Now edit gradle-wrapper.properties and add latest version of gradle there.After updation my gradle-wrapper.properties looked like this.

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.11-all.zip

Now Sync project. Thats it.
Happy Coding Guys.Have a great day.

Answer:

I also faced the same problem.I exited from Android Studio and re-opened Android Studio.In my case,The Problem Solved Then.You Can Try this Procedure.

Answer:

Solution: The only workaround for me is to use ipv6 instead of ipv4 : in bin/studio.vmoptions or bin/studio64.vmoptions (depending on if you are in 32 or 64 bits), change the line

  • Djava.net.preferIPv4Stack=true

by

  • Djava.net.preferIPv6Stack=true

Answer:

If any of the cases mentioned here didn’t meet the expectations, there may be something wrong with your dnsapi.dll file in your windows which several software use (It happens in rare cases but give it a try).

Close Android Studio and try running a program(software) that uses this dnsapi.dll file. For ex. try running BitTorrent. If it says 'DNSapi.dll missing from your computer', then the studio error is most probably because of the corrupted/missing dll file.

Try running following command on your command prompt.(Make sure you have a good internet connection)

DISM.exe /Online /Cleanup-image /Restorehealth

And then run the system file checker.

sfc /scannow

It would take some time.
Now run Android studio.

Answer:

I just followed the other answer but I couldn’t find the registry.bin.lock file in mac, then I just deleted the following folders,’

  • /Users/../.gradle/caches

  • /Users/../.gradle/daemon

then do a File-> Invalidate Caches/Restart.
The above folders should be updated during Gradle Sync, just say yes if it throws popup for gradle update

Please take a backup of these folders before deleting.

Answer:

In my case, after trying all of the above, I realised:

  • I was using the wifi network @ brandname coffeshop which had authentification.
  • I also had Global Gradle settings :”Offline work” activated (Settings/Build,Execution,Deployment/Gradle/Global Gradle settings).

I switched to my phone hotspot, and deactivated the Offline work.

Now (after 1 and a half hours) my builds are running again.

Hope this helps.

Answer:

Sitting on MacOs 10.14.6 tried these things:

  • Close/Open Android Studio
  • Invalidate caches/Restart
  • Download latest NDK from Tools/SDK Manager
  • Delete all NDKs from mac

Nothing helped. The only worked is reset Mac

Still dont know what caused this behaviour