3

When I started building my Android app project I found an error:

FAILURE: Build failed with an exception.

* What went wrong:
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 http://gradle.org/docs/2.2.1/userguide/gradle_daemon.html
Please read the following process output to find out more:
-----------------------
Unrecognized VM option 'MaxPermSize=256m'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.


* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

/var/www/html/ionicApp/platforms/android/cordova/node_modules/q/q.js:126
                    throw e;
                    ^
Error code 1 for command: /var/www/html/ionicApp/platforms/android/gradlew with args: cdvBuildDebug,-b,/var/www/html/ionicApp/platforms/android/build.gradle,-Dorg.gradle.daemon=true
ERROR building one of the platforms: Error: /var/www/html/ionicApp/platforms/android/cordova/build: Command failed with exit code 1

I tried what was said in this Stack Overflow answer. Even then, my problem wasn't fixed. Not even after configuring it offline.

When I googled this error I found it's something related to Android Studio, but I am not on Studio. I am confused as this is my first experience with handling a java-related task.

Can anyone suggest how to solve this?

Community
  • 1
  • 1
anujayk
  • 544
  • 7
  • 31
  • Possible duplicate of [Android Studio: Unable to start the daemon process](http://stackoverflow.com/questions/20471311/android-studio-unable-to-start-the-daemon-process) – Vahid Farahmandian May 14 '16 at 13:13

4 Answers4

1

This is a Gradle issue, not really and Android Studio one. The Gradle daemon is used to optimize the build performance. By default it is configured via a properties file /~/.gradle/gradle.properties. You can learn more by reading the first doc link provided in the error message.

The error message tells everything you need to know about the error, in particular:

Unrecognized VM option 'MaxPermSize=256m'

This unrecognized option prevents Gradle from starting the JVM that runs the Gradle dameon. I presume that this option should be -XX:MaxPermSize=256m instead. If no syntax of this option works for you, you can try and disable the daemon by setting in the properties file:

org.gradle.daemon=false

Your build will still run and may be slower - how much slower is impossible to say, it might not even be noticeable.

Lolo
  • 4,277
  • 2
  • 25
  • 24
  • i don't find gradle installed in my system.How may i configure.Do i need to install it and configure it ?if it is so much needed in my development – anujayk Oct 10 '15 at 07:36
  • It's got to be there, otherwise it wouldn't start and givze you the error. You need to look in whatever build script you run ot build Ionic for references to gradle and/or the daemon. From the error messages, it looks like you're using node.js to actually build it, right? There's got to be a script that uses gradle behind the scene. I can't tell you more because I don't know node.js – Lolo Oct 10 '15 at 07:45
0

After changing the setting in the environment you should restart your Command Prompt CMD to update environment variables

0

If not already defined try defining JAVA_HOME and ANDROID_HOME in you path variables to the respective jdk path and android sdk path.

Munam Yousuf
  • 431
  • 1
  • 6
  • 17
0

I was facing same problem , It may be because of JAVA_HOME pointing to 32 bit java

JAVA_HOME = "C:\Programe Files (x86)\Java\jdk1.8.0_40"

So Installed Java 64 bit and changed JAVA_HOME to

JAVA_HOME = "C:\Programe Files\Java\jdk1.8.0_40"

And Its works for me,

Cheers,

Rakesh Chaudhari
  • 3,310
  • 1
  • 27
  • 25