Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gradle error to download when execute ionic build android #1800

Closed
jgw96 opened this issue Dec 21, 2016 · 3 comments
Closed

Gradle error to download when execute ionic build android #1800

jgw96 opened this issue Dec 21, 2016 · 3 comments

Comments

@jgw96
Copy link
Contributor

jgw96 commented Dec 21, 2016

From @PterPmnta on December 20, 2016 5:12

I am try to compile an new project using command ionic build android, but i get this error:

C:\Users\pedromiguel\aplicacionesIonic\sqliteTest>ionic build android
Running command: "C:\Program Files\nodejs\node.exe" C:\Users\pedromiguel\aplicacionesIonic\sqliteTest\hooks\after_prepare\010_add_platform_class.js C:\Users\pedromiguel\aplicacionesIonic\sqliteTest


add to body class: platform-android

ANDROID_HOME=C:\Users\pedromiguel\AppData\Local\Android\sdk

JAVA_HOME=C:\Program Files\Java\jdk1.8.0_101

Subproject Path: CordovaLib



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:
-----------------------
Error occurred during initialization of VM
Could not reserve enough space for 2097152KB object heap


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

Error: cmd: Command failed with exit code 1 Error output:
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:
-----------------------
Error occurred during initialization of VM
Could not reserve enough space for 2097152KB object heap


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

###System info

C:\Users\pedromiguel\aplicacionesIonic\sqliteTest>ionic info

Your system information:

 ordova CLI: 6.4.0
Ionic CLI Version: 2.1.17
Ionic App Lib Version: 2.1.7
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 10
Node Version: v5.5.0
Xcode version: Not installed

I do it all answer in that question, but dont work. If anyone know some solution, help me.

Copied from original issue: ionic-team/ionic-framework#9718

@jgw96
Copy link
Contributor Author

jgw96 commented Dec 21, 2016

From @jayeshanandani on December 20, 2016 18:2

Please try to use Node LTS (6.9.2) and also this seems more of an android issue rather than an ionic issue. Just looking at your error messages:

Error occurred during initialization of VM Could not reserve enough space for 2097152KB object heap

This lines should help you resolve that. Please ask at StackOverflow or Ionic Support Forums.

@jgw96
Copy link
Contributor Author

jgw96 commented Dec 21, 2016

From @PterPmnta on December 20, 2016 22:59

@jayeshanandani I ask in StackOverflow, but the same answer don't work for me, but i don't in ionic forum yet.

@tusharkkumar
Copy link

fix is here (FOR WINDOWS ONLY)

I am facing the same problem of Build then i finally found out the solution.

SOLUTION

So You must have the Android Api 23 in order for this command to work.

Error of Daemon process will be solve after installing the Api 23 and extra
build tools and run command

COMMAND : cordova build android --release

I am sure this fix would help you to solve the problem.

STEPS

  1. First check the version of android through this COMMAND:
    cordova platform help
  2. Run the build command after installing the Api 23 and extra build tools.
  3. If Even this not work then Try add the variable in the

    Environment variables > System variables >

    add _JAVA_OPTIONS and value = -Xmx512M

Then Run cordova build android --release

BUT FIRSTLY SET UP THE ENVIRONMENT VARIABLES

Environment Variable setup Image

android API 23

COPY FROM HERE

ENVIRONMENT VARIABLES:-

  1. USER VARIABLES

    PATH

    C:\Ruby23\bin;C:\Users\kumar\AppData\Roaming\npm;C:\ANDROID_SDK\tools;%SystemRo
    ot%\system32; %SystemRoot%; %SystemRoot%\System32\Wbem;

  2. SYSTEM VARIABLES

    ADD NAME AND VALUE

    2.1 _JAVA_OPTIONS -Xmx512M

    2.2 ANDROID_HOME C:\ANDROID_SDK

    2.3 PATH ->

    C:\ProgramFiles\Java\jdk1.8.0_60\bin;C:\ProgramFiles\nodejs;C:\Gradle\gradle-4.0\bin;C:\ANDROID_SDK\tools;%SystemRoot%\system32; %SystemRoot%; %SystemRoot%\System32\Wbem;%SystemRoot%\system32; %SystemRoot%; %SystemRoot%\System32\Wbem;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants