-2

Gradle 'My Application' project refresh failed 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 https://docs.gradle.org/4.1/userguide/gradle_daemon.html

Please read the following process output to find out more:

-Xmx1536m: illegal argument
usage: java [-options] class

where options include:
    -help             print out this message
    -version          print out the build version
    -v -verbose       turn on verbose mode
    -debug            enable remote JAVA debugging
    -noasyncgc        don't allow asynchronous garbage collection
    -verbosegc        print a message when garbage collection occurs
    -noclassgc        disable class garbage collection
    -ss<number>       set the maximum native stack size for any thread
    -oss<number>      set the maximum Java stack size for any thread
    -ms<number>       set the initial Java heap size
    -mx<number>       set the maximum Java heap size
    -classpath <directories separated by semicolons>
                      list directories in which to look for classes
    -prof[:<file>]    output profiling data to .\java.prof or .\<file>
    -verify           verify all classes when read in
    -verifyremote     verify classes read in over the network [default]
    -noverify         do not verify any class
    -nojit            disable JIT compiler

Consult IDE log for more details (Help | Show Log)

Zoe
  • 27,060
  • 21
  • 118
  • 148
  • 1
    This is your problem. **unrecognized jvm option -Xmx1536m** Read [this](https://stackoverflow.com/questions/40474050/android-studio-where-to-install-ndk-file-downloaded-it-in-zip/40475804#40475804) for how to set it. (Look at your question (**where options include**), looks like **-Xmx1536m** should be **-mx1536m** ) – Jon Goodwin Mar 03 '19 at 07:42

1 Answers1

2

You can delete the folder ~/.gradle on your machine and re-run the build.

Gourav
  • 2,746
  • 5
  • 28
  • 45
Ranjan Kumar
  • 1,164
  • 7
  • 12
  • In my case, somehow there was a gradle.properties in the ~/.gradle directory which was overriding all other project's JVM args (just as of today and out of the blue). I got rid of it and the issue disappeared. – David S Alderson Mar 07 '19 at 21:17