This is the most common errors that we see in Android Studio and very often it is easy to fix.
Just follow these simple steps

  1. File -> Invalidate caches / Restart
  2. Shutdown Android Studio
  3. Rename/remove .gradle folder in the user home directory
  4. Restart Android Studio let it download all the Gradle stuff it needs
  5. Gradle build success should come(Make sure you are not behind any proxy).
  6. Rebuild project!

Try it, it should work…



  1. Ujjwol Dandekhya June 5, 2017 at 8:15 am

    What do you mean by ‘.gradle’ folder?
    Do you mean “C:\Program Files\Android\Android Studio\gradle” this folder in my directory?
    It is about 140 MB of files, I want to know if its safe deleting this load of data?
    Just wanted to save the hassle of reinstalling the whole Software in case it gets messed up..

    • James June 5, 2017 at 6:34 pm


      .gradle is a hidden file, not this one C:\Program Files\Android\Android Studio\gradle.
      Unhide all hidden folders and you will see.

  2. yjane October 23, 2017 at 3:09 pm

    Error:Unable to start the daemon process.
    This problem might be caused by incorrect configuration of the daemon.
    For example, an unrecognized jvm option is used.
    Please refer to the user guide chapter on the daemon at
    Please read the following process output to find out more:
    Error: Could not create the Java Virtual Machine.
    Error: A fatal exception has occurred. Program will exit.
    Unrecognized option: –Xmx512m

    this one popped up

  3. James January 8, 2018 at 11:18 am

    Please close all applications using java and then try deleting .gradle folder. Reinstalling gradle will bring back the folder, so don’t worry.


Leave a Reply

Your email address will not be published. Required fields are marked *




Theme by HermesThemes

Copyright © 2018 CoderzHeaven. All Rights Reserved

Please wait...

Subscribe to our newsletter

Want to be notified when our article is published? Enter your email address and name below to be the first to know.