简体   繁体   English

使用Oracle Java在Jenkins中构建android项目

[英]Build android project in jenkins with oracle java

I am getting this error when am trying to build an android with jenkins. 尝试使用jenkins构建Android时出现此错误。 I do not think the error is jenkins related. 我认为错误与詹金斯无关。

Execution failed for task ':app:preDexProductionDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/usr/lib/jvm/java-7-oracle/bin/java'' finished with non-zero exit value 137

the command that i am trying to execute (ProductionDebug is a flavour) 我尝试执行的命令(ProductionDebug很有趣)

./gradlew clean assembleProductionDebug --stacktrace

Edit 1 So I figured that this was an Out Of Memory Error from this Q/A 编辑1因此,我认为这是此Q / A中的内存不足错误

and the Jenkins Wiki also catalogs it here Jenkins Wiki也在这里分类

Now my question is: Is it possible to run an android build with 1gb RAM? 现在我的问题是:是否可以运行具有1GB RAM的Android版本?

Edit 2 编辑2

I tried with with java 7u25 too,now the whole system becomes unresponsive and requires a restart from the AWS console. 我也尝试使用Java 7u25,现在整个系统变得无响应,需要从AWS控制台重新启动。

we had the same problem a while ago, it turns out we have some errors in the RAM of the server we were useing. 不久前我们遇到了同样的问题,事实证明我们正在使用的服务器RAM中存在一些错误。 So I suggest you to run some tests on you server. 因此,我建议您在服务器上运行一些测试。

As for your question, 1GB RAM for the entire system or just for your project. 至于您的问题,整个系统或仅用于您的项目的1GB RAM。

PS - Sorry for my ENG, it isn't that good, I hope this will help somehow. PS-对不起,我的ENG不好,我希望这会有所帮助。

So I managed to to make this work. 所以我设法使这项工作。 providing a 512 mb swap memory managed to assemble the app.Although it takes about 8~9 minutes. 提供了512 mb的交换内存来管理应用程序。尽管大约需要8到9分钟。

I wont accept this answer hoping that there is a better solution. 我不会接受这个答案,希望有更好的解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM