Error when testing the ionic application on the cell phone

1

I want to test the ionic application on the cell phone, not on an emulator, by executing the command:

ionic run android

and having the cell phone in debugging mode activated and connected to the PC, I receive the following error:

 Error ocurred  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 want wrong:
unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvmoption is used.
Please refer to the user guide chapter on the daemon at https://docs.gradle.org/2.14.1/userguide/gradle_daemon.html
Please read the following process output to find out more:
    
asked by Fabian 09.01.2017 в 20:22
source

2 answers

1

This happened to me a while ago and I solved it in this way:

  • Open a console as administrator (as you mention you are in windows 10 you do it by pressing the windows + x key and clicking "Command Prompt (administrator)" ).
  • You write on it (the console ) the following command :

      

    set _JAVA_OPTIONS = -Xmx512M

  • Restart the computer and try again

  • This is another way to do the above (in my opinion a little longer):

    Go to: Control Panel (you must have the view in Categories ) - > System and Security - > System - > Advanced system configuration (It is in "TAB" mode on the left side) - > Environment variables

    There you click on " New " where you will put _JAVA_OPTIONS as " Name of " and -Xmx512M as " Value of ", you accept, restart the computer and try again.

        
    answered by 10.01.2017 / 15:18
    source
    1

    Try typing in the terminal

    ionic run android --device
    

    Edit:

    Try the following:

    Ejecuta en la terminal "adb kill-server"
    Espera 20 segundos y conecta el móvil al PC.
    Ejecuta en la terminal "adb start-server"
    Comprueba los dispositivos conectados con "adb
    devices" en la terminal.
    
        
    answered by 10.01.2017 в 14:33