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

jenkins 构建Android自动打包报错如下:


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
Java HotSpot(TM) Client VM warning: ignoring option MaxPermSize=512m; support was removed in 8.0


* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Build step 'Execute Windows batch command' marked build as failure
Finished: FAILURE


解决办法:进入jenkins下的Android项目目录:

我的为:C:\Users\Administrator\.jenkins\workspace\android\android\AiLiApp

打开gradle.properties,

找到 org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8


将org.gradle.jvmargs=-Xmx2048m 改为org.gradle.jvmargs=-Xmx1024m保存。

jenkins重新构建Android项目,这时可构建成功

你可能感兴趣的:(Jenkins)