Android的摇篮构建脚本在preDexDebug返回错误137 [英] Android gradle build script returns error 137 in preDexDebug
问题描述
我想我们的Debian构建服务器gradlew上建立一个Android项目。
I am trying to build an Android project on our Debian build server with gradlew.
我每次运行构建失败的preDexDebug一步,错误137和下面的错误。我试过堆栈跟踪,但这并没有给我任何更多的信息,但它是一个未处理的异常。在控制台中,我可以看到preDexDebug生成步骤失败的39%。
Each time I run it the build fails on the preDexDebug step with error 137 and the following error. I tried the stacktrace but this didn't give me any more information, except that it is an unhandled exception. In the console I can see the preDexDebug build step fail at 39%.
:Carpool:preDexDebug FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':Carpool:preDexDebug'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
/opt/android-sdk-linux/build-tools/19.0.3/dx --dex --output /var/lib/jenkins/jobs/Project/workspace/com.app.space/Carpool/build/pre-dexed/debug/classes-c1baba1a2bb3528538a151852945d1f7047c7393.jar /var/lib/jenkins/jobs/Project/workspace/com.app.space/Carpool/build/exploded-aar/com.google.android.gms/play-services/4.0.30/classes.jar
Error Code:
137
构建脚本:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.9.+'
}
}
apply plugin: 'android'
repositories {
mavenCentral()
}
android {
compileSdkVersion 19
buildToolsVersion "19.0.3"
defaultConfig {
minSdkVersion 10
targetSdkVersion 19
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}
dependencies {
compile 'com.android.support:support-v4:19.1.0'
compile 'com.android.support:gridlayout-v7:19.1.0'
compile 'com.android.support:appcompat-v7:19.1.0'
compile 'com.google.android.gms:play-services:4.0.30'
}
这个问题,解决方法或额外的检查,我可以做的原因任何想法?
Any ideas on the cause of this problem, workarounds or additional checks I could do?
推荐答案
该问题是由于在构建服务器内存问题。切换到构建服务器有更多的内存已经解决了问题。
The problem was due to memory problems on the build server. Switching to a build server with more memory has fixed the problem.
这篇关于Android的摇篮构建脚本在preDexDebug返回错误137的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!