SQLite ionic 3 - Error when ionic cordova Build android


#1

sorry, i’m very beginner in ionic & cordova, when i try to build function SQLite i getting error,

this my req :

and this is my error :

cordova build android
[14:25:53] lint finished in 17.84 s
ANDROID_HOME=C:\Users\admin\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files (x86)\Java\jdk1.8.0_102
Subproject Path: CordovaLib
Starting a Gradle Daemon (subsequent builds will be faster)

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 https://docs.gradle.org/3.3/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 https://docs.gradle.org/3.3/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] An error occurred while running cordova build android (exit code 1).

Can somebody help??

thanks
kind regards


#2

https://github.com/ionic-team/ionic/issues/10970

this is similar issue.


#3

You seem to be using 32bit JDK in a 64bit system. I think you need to switch to 64 bit.
Check https://stackoverflow.com/questions/41216921/cordova-could-not-reserve-enough-space-for-2097152kb-object-heap


#4

i found the solution of this problem…

this trick solved to my problem

Change argument -Xmx20484m to 1024 at line:
args.push(’-Dorg.gradle.jvmargs=-Xmx1024m’);
in your project file platforms\android\cordova\lib\builders\GradleBuilder.js.

thanks all for the answer :slight_smile: