4
respostas

Problemas com gradle

Então, configurei a variável de ambiente e ainda não consigo gerar a buld, mas agora migrei o projeto pro windows por questões de praticidade.

Porém quando executo o comando 'Ionic build android' ele retorna a seguinte msg:

Starting a new Gradle Daemon for this build (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/2.14.1/usergui de/gradle_daemon.htmlPlease read the following process output to find out more: Error occurred during initialization of VMCould 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/2.14.1/usergui de/gradle_daemon.htmlPlease read the following process output to find out more: Error occurred during initialization of VMCould 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.

4 respostas

Eu lembro que tive um problema com o Gradle quando fiz o curso de Android, dava um erro por causa da memória. Lá tinha uma aba Gradle e um arquivo de settings, onde eu coloquei um valor menor.

Eu olhei a pasta android que é criada pelo IONIC, e apesar de ter arquivos gradle na raiz e ter duas pastas gradle, não achei nada para configurar este valor.

Acredito que ele esteja pegando o valor da memória da variável de sistema _JAVA_OPTIONS

Tente alterar o valor da variável para

-Xmx512M

Olá,

Criei uma variavel de sistema _JAVA_OPTIONS passando o valor indicado a cima -Xxm512M.

Porém o erro persiste, infelizmente não consigo gerar build, Não consigo de forma alguma, mesmo com ajuda do stackoverflow. A mensagem de erro segue abaixo:

ionic build android

ionic-hello-world@ ionic:build C:\laragon\www\myApp ionic-app-scripts build

[21:09:38] ionic-app-scripts 1.0.0 [21:09:38] build dev started ... [21:09:38] clean started ... [21:09:39] clean finished in 22 ms [21:09:39] copy started ... [21:09:39] transpile started ... [21:09:45] transpile finished in 6.21 s [21:09:45] webpack started ... [21:09:45] copy finished in 6.64 s [21:09:55] webpack finished in 10.16 s [21:09:55] sass started ... [21:09:56] sass finished in 1.34 s [21:09:57] build dev finished in 18.23 s ANDROID_HOME=C:\Users\adria\AppData\Local\Android\sdk

JAVA_HOME=C:\Program Files (x86)\Java\jdk1.8.0_121

Subproject Path: CordovaLib

Starting a new Gradle Daemon for this build (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/2.14.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 https://docs.gradle.org/2.14.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.

to tendo o mesmo problema

Adriano,

você passou como valor da variável -Xxm512M ou -Xmx512M ???