完成的gradle非零退出值3 [英] gradle finished with non-zero exit value 3
问题描述
我的项目包含3个库: calendar_cmcc Wheel_library 和 yellowPage_lib
我可以建立很好的项目,但gradle这个抛出一个错误,当我跑it.Here是错误:
错误:执行失败的任务:应用程序:dexDebug。
com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:过程'命令'/home/jim/tools/jdk1.8.0_45/bin/java'与非完零退出值3
块引用>gradle这个文件列表:
应用的的build.gradle:
应用插件:'com.android.application 安卓{ compileSdkVersion 21
buildToolsVersion '21 .1.2 defaultConfig {
的applicationIDcn.com.geartech.app
17的minSdkVersion
targetSdkVersion 19
版本code 100 // 20日至21
// cmcc0000522 26
// 0608是
// 27
// 0615 27
// 0616 27
//1.2.20 36
的versionName1.2.26.10
multiDexEnabled =真
}
buildTypes {
发布 {
minifyEnabled假
proguardFiles getDefaultProguardFile('proguard的-android.txt'),'proguard-rules.pro
} 调试{
signingConfig signingConfigs.deb
}
}
packagingOptions {
排除META-INF /相关内容
排除META-INF /注意事项
排除META-INF / LICENSE
排除META-INF / LICENSE.TXT
排除META-INF / NOTICE.txt
排除META-INF / ASL2.0
}
sourceSets {
主要{
jniLibs.srcDir'的src / main /库
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
} 依赖{
编译com.android.support:support-v4:20.+
编译com.android.support:recyclerview-v7:21.0.0
编译com.daimajia.swipelayout:库:1.2.0@aar
编译jp.wasabeef:recyclerview-动画师:1.0.3@aar
编译文件树(包括:['的* .jar'],DIR:库)
编译文件('的src / main /库/公地IO-2.4.jar')
编译文件('的src / main /库/ httpmime-4.1.1.jar')
编译文件('的src / main /库/ pinyin4j-2.5.0.jar')
编译文件('的src / main /库/通用图像装载-1.9.3-与-sources.jar')
编译文件('的src / main /库/ zxing.jar')
编译com.sothree.slidinguppanel:库:3.0.0
编译文件('的src / main /库/ CMCC-SSO-sdk.jar')
编译文件('的src / main /库/ CMCC-sso.jar')
编译文件('的src / main /库/ cmcc_enc.jar')
编译文件('的src / main /库/ AOE_20140617_001.jar')
编译文件('的src / main /库/ sync_sdk_ydyjyxgh_20150304.jar')
编译文件('的src / main /库/ FASTJSON-1.2.5.jar')
编制项目(':yellowPage_lib')
编制项目(':Wheel_library')
编制项目(':calendar_cmcc')
编译文件('的src / main /库/ pinyin4j.jar')
编译文件('的src / main /库/ gcordSDK.jar')
}中的build.gradle calendar_cmcc
应用插件:'com.android.library 安卓{
compileSdkVersion 21
buildToolsVersion21.1.2 defaultConfig {
17的minSdkVersion
targetSdkVersion 17
版本code 1
的versionName1.0
}
buildTypes {
发布 {
minifyEnabled假
proguardFiles getDefaultProguardFile('proguard的-android.txt'),'proguard-rules.pro
}
}
productFlavors {
}
lintOptions {
abortOnError假
}
packagingOptions {
排除META-INF / LICENSE.TXT
排除META-INF / NOTICE.txt
}
}
configurations.all {
排除模块:'的commons-logging
}
依赖{
编译文件树(包括:['的* .jar'],DIR:库)
编译公地郎咸平:公地郎咸平:2.6
编译公地IO:公地IO:2.4
编译org.projectlombok:龙目:1.14.8
编译org.mnode.ical4j:ical4j:1.0.6
编译('com.google code.ez-名片:EZ-名片:0.9.6'){
排除组:org.jsoup',模块:jsoup
排除组:org.freemarker',模块:'FreeMarker的'
排除组:com.fasterxml.jackson.core',模块:杰克逊 - 核心
}
编译dnsjava:dnsjava:2.1.6
编译文件(LIB / HttpClient的,Android的4.3.5.2-davdroid1.jar')
编译('org.simpleframework:简单的xml:2.7.1'){
排除组:STAX,模块:STAX的API
排除组:XPP3',模块:'XPP3
}
编译com.android.support:appcompat-v7:18.0.0
编译文件(库/ Android的共chips.jar')
编译文件(库/ Android的common.jar')
编译文件(库/日历common.jar')
}中的build.gradle Wheel_library
应用插件:'com.android.library
安卓{
compileSdkVersion 21
buildToolsVersion '21 .1.2 defaultConfig {
17的minSdkVersion
targetSdkVersion 19
版本code 1
的versionName1.0
}
buildTypes {
发布 {
minifyEnabled假
proguardFiles getDefaultProguardFile('proguard的-android.txt'),'proguard-rules.pro
}
}
} 依赖{
编译文件树(包括:['的* .jar'],DIR:库)
}中的build.gradle yellowPage_lib
应用插件:'com.android.library 安卓{
compileSdkVersion 21
buildToolsVersion '21 .1.2 defaultConfig {
8的minSdkVersion
targetSdkVersion 19
} buildTypes {
发布 {
minifyEnabled假
proguardFiles getDefaultProguardFile('proguard的-android.txt'),'proguard的-rules.txt
}
}
} 依赖{
编译com.android.support:support-v4:19.+
编译文件(库/ BaiduLBS_Android.jar')
编译文件(库/ YellowPage_SDK.jar')
}现在,我只kown的是,错误是由原因的 calendar_cmcc的的build.gradle file.When我变编译,从依赖'提供' calendar_cmcc的建.gradle,它运行良好。
{相关性
编译文件树(包括:['的* .jar'],DIR:库)
编译公地郎咸平:公地郎咸平:2.6
编译公地IO:公地IO:2.4
编译org.projectlombok:龙目:1.14.8
编译org.mnode.ical4j:ical4j:1.0.6
编译('com.google code.ez-名片:EZ-名片:0.9.6'){
排除组:org.jsoup',模块:jsoup
排除组:org.freemarker',模块:'FreeMarker的'
排除组:com.fasterxml.jackson.core',模块:杰克逊 - 核心
}
编译dnsjava:dnsjava:2.1.6
编译文件(LIB / HttpClient的,Android的4.3.5.2-davdroid1.jar')
编译('org.simpleframework:简单的xml:2.7.1'){
排除组:STAX,模块:STAX的API
排除组:XPP3',模块:'XPP3
}
编译com.android.support:appcompat-v7:18.0.0
编译文件(库/ Android的共chips.jar')
编译文件(库/ Android的common.jar')
编译文件(库/日历common.jar')
}改成
{相关性
编译文件树(包括:['的* .jar'],DIR:库)
编译公地郎咸平:公地郎咸平:2.6
编译公地IO:公地IO:2.4
提供'org.projectlombok:龙目:1.14.8
提供'org.mnode.ical4j:ical4j:1.0.6
提供('com.google code.ez-名片:EZ-名片:0.9.6'){
排除组:org.jsoup',模块:jsoup
排除组:org.freemarker',模块:'FreeMarker的'
排除组:com.fasterxml.jackson.core',模块:杰克逊 - 核心
}
编译dnsjava:dnsjava:2.1.6
编译文件(LIB / HttpClient的,Android的4.3.5.2-davdroid1.jar')
编译('org.simpleframework:简单的xml:2.7.1'){
排除组:STAX,模块:STAX的API
排除组:XPP3',模块:'XPP3
}
编译com.android.support:appcompat-v7:18.0.0
编译文件(库/ Android的共chips.jar')
编译文件(库/ Android的common.jar')
编译文件(库/日历common.jar')
}但它会导致另一个错误:
15 07-24:54:41.991 32166-1373 / cn.com.geartech.app E / dalvikvm:找不到类的net.fortuna.ical4j.model.DefaultTimeZoneRegistryFactory从方法at.bitfire.davdroid.resource.Event引用< clinit>
07-24 15:54:42.001 32166-1373 / cn.com.geartech.app E / dalvikvm:找不到类的net.fortuna.ical4j.data.CalendarBuilder,从法at.bitfire.davdroid.resource引用。 Event.TimezoneDefToTzId
07-24 15:54:42.021 32166-1373 / cn.com.geartech.app E / dalvikvm:找不到类的net.fortuna.ical4j.util.UidGenerator,从法at.bitfire.davdroid.resource引用。 Event.generateUID
07-24 15:54:42.061 32166-1373 / cn.com.geartech.app E / dalvikvm:找不到类的net.fortuna.ical4j.data.CalendarBuilder,从法at.bitfire.davdroid.resource引用。 Event.parseEntity看来,在 org.mnode.ical4j 不能包中的APK时构建的gradle
我有搜索的计算器多日的答案,但它不能工作。
所以,我应该怎么办?帮助,请!谢谢!解决方案我重新发布jim.zhang的答案在这里:
(因为我第一次看到这个问题,我错过了张的评论)添加以下配置中的build.gradle文件。
dexOptions {
javaMaxHeapSize4G
}My project contains 3 libraries: calendar_cmcc,Wheel_library and yellowPage_lib.
I can build the project perfectly, but gradle throws an error when I run it.Here is the error:
Error:Execution failed for task ':app:dexDebug'.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/home/jim/tools/jdk1.8.0_45/bin/java'' finished with non-zero exit value 3
gradle file list:
app's build.gradle:
apply plugin: 'com.android.application' android { compileSdkVersion 21 buildToolsVersion '21.1.2' defaultConfig { applicationId "cn.com.geartech.app" minSdkVersion 17 targetSdkVersion 19 versionCode 100 //from 20 to 21 //cmcc0000522 is 26 //0608 is // 27 //0615 is 27 //0616 is 27 //1.2.20 36 versionName "1.2.26.10" multiDexEnabled = true } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } debug { signingConfig signingConfigs.deb } } packagingOptions { exclude 'META-INF/DEPENDENCIES' exclude 'META-INF/NOTICE' exclude 'META-INF/LICENSE' exclude 'META-INF/LICENSE.txt' exclude 'META-INF/NOTICE.txt' exclude 'META-INF/ASL2.0' } sourceSets { main { jniLibs.srcDir 'src/main/libs' } } compileOptions { sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 } } dependencies { compile 'com.android.support:support-v4:20.+' compile 'com.android.support:recyclerview-v7:21.0.0' compile 'com.daimajia.swipelayout:library:1.2.0@aar' compile 'jp.wasabeef:recyclerview-animators:1.0.3@aar' compile fileTree(include: ['*.jar'], dir: 'libs') compile files('src/main/libs/commons-io-2.4.jar') compile files('src/main/libs/httpmime-4.1.1.jar') compile files('src/main/libs/pinyin4j-2.5.0.jar') compile files('src/main/libs/universal-image-loader-1.9.3-with-sources.jar') compile files('src/main/libs/zxing.jar') compile 'com.sothree.slidinguppanel:library:3.0.0' compile files('src/main/libs/cmcc-sso-sdk.jar') compile files('src/main/libs/cmcc-sso.jar') compile files('src/main/libs/cmcc_enc.jar') compile files('src/main/libs/AOE_20140617_001.jar') compile files('src/main/libs/sync_sdk_ydyjyxgh_20150304.jar') compile files('src/main/libs/fastjson-1.2.5.jar') compile project(':yellowPage_lib') compile project(':Wheel_library') compile project(':calendar_cmcc') compile files('src/main/libs/pinyin4j.jar') compile files('src/main/libs/gcordSDK.jar') }
build.gradle of calendar_cmcc:
apply plugin: 'com.android.library' android { compileSdkVersion 21 buildToolsVersion "21.1.2" defaultConfig { minSdkVersion 17 targetSdkVersion 17 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } productFlavors { } lintOptions { abortOnError false } packagingOptions { exclude 'META-INF/LICENSE.txt' exclude 'META-INF/NOTICE.txt' } } configurations.all { exclude module: 'commons-logging' } dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') compile 'commons-lang:commons-lang:2.6' compile 'commons-io:commons-io:2.4' compile 'org.projectlombok:lombok:1.14.8' compile 'org.mnode.ical4j:ical4j:1.0.6' compile('com.googlecode.ez-vcard:ez-vcard:0.9.6') { exclude group: 'org.jsoup', module: 'jsoup' exclude group: 'org.freemarker', module: 'freemarker' exclude group: 'com.fasterxml.jackson.core', module: 'jackson-core' } compile 'dnsjava:dnsjava:2.1.6' compile files('lib/httpclient-android-4.3.5.2-davdroid1.jar') compile('org.simpleframework:simple-xml:2.7.1') { exclude group: 'stax', module: 'stax-api' exclude group: 'xpp3', module: 'xpp3' } compile 'com.android.support:appcompat-v7:18.0.0' compile files('libs/android-common-chips.jar') compile files('libs/android-common.jar') compile files('libs/calendar-common.jar') }
build.gradle of Wheel_library:
apply plugin: 'com.android.library' android { compileSdkVersion 21 buildToolsVersion '21.1.2' defaultConfig { minSdkVersion 17 targetSdkVersion 19 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') }
build.gradle of yellowPage_lib:
apply plugin: 'com.android.library' android { compileSdkVersion 21 buildToolsVersion '21.1.2' defaultConfig { minSdkVersion 8 targetSdkVersion 19 } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' } } } dependencies { compile 'com.android.support:support-v4:19.+' compile files('libs/BaiduLBS_Android.jar') compile files('libs/YellowPage_SDK.jar') }
Now, All I kown is that the error was cause by calendar_cmcc's build.gradle file.When I change 'compile' to 'provided' of dependencies from calendar_cmcc's build.gradle , it runs fine.
dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') compile 'commons-lang:commons-lang:2.6' compile 'commons-io:commons-io:2.4' compile 'org.projectlombok:lombok:1.14.8' compile 'org.mnode.ical4j:ical4j:1.0.6' compile('com.googlecode.ez-vcard:ez-vcard:0.9.6') { exclude group: 'org.jsoup', module: 'jsoup' exclude group: 'org.freemarker', module: 'freemarker' exclude group: 'com.fasterxml.jackson.core', module: 'jackson-core' } compile 'dnsjava:dnsjava:2.1.6' compile files('lib/httpclient-android-4.3.5.2-davdroid1.jar') compile('org.simpleframework:simple-xml:2.7.1') { exclude group: 'stax', module: 'stax-api' exclude group: 'xpp3', module: 'xpp3' } compile 'com.android.support:appcompat-v7:18.0.0' compile files('libs/android-common-chips.jar') compile files('libs/android-common.jar') compile files('libs/calendar-common.jar') }
changed to
dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') compile 'commons-lang:commons-lang:2.6' compile 'commons-io:commons-io:2.4' provided 'org.projectlombok:lombok:1.14.8' provided 'org.mnode.ical4j:ical4j:1.0.6' provided ('com.googlecode.ez-vcard:ez-vcard:0.9.6') { exclude group: 'org.jsoup', module: 'jsoup' exclude group: 'org.freemarker', module: 'freemarker' exclude group: 'com.fasterxml.jackson.core', module: 'jackson-core' } compile 'dnsjava:dnsjava:2.1.6' compile files('lib/httpclient-android-4.3.5.2-davdroid1.jar') compile('org.simpleframework:simple-xml:2.7.1') { exclude group: 'stax', module: 'stax-api' exclude group: 'xpp3', module: 'xpp3' } compile 'com.android.support:appcompat-v7:18.0.0' compile files('libs/android-common-chips.jar') compile files('libs/android-common.jar') compile files('libs/calendar-common.jar') }
but it will cause another error:
07-24 15:54:41.991 32166-1373/cn.com.geartech.app E/dalvikvm﹕ Could not find class 'net.fortuna.ical4j.model.DefaultTimeZoneRegistryFactory', referenced from method at.bitfire.davdroid.resource.Event.<clinit> 07-24 15:54:42.001 32166-1373/cn.com.geartech.app E/dalvikvm﹕ Could not find class 'net.fortuna.ical4j.data.CalendarBuilder', referenced from method at.bitfire.davdroid.resource.Event.TimezoneDefToTzId 07-24 15:54:42.021 32166-1373/cn.com.geartech.app E/dalvikvm﹕ Could not find class 'net.fortuna.ical4j.util.UidGenerator', referenced from method at.bitfire.davdroid.resource.Event.generateUID 07-24 15:54:42.061 32166-1373/cn.com.geartech.app E/dalvikvm﹕ Could not find class 'net.fortuna.ical4j.data.CalendarBuilder', referenced from method at.bitfire.davdroid.resource.Event.parseEntity
It seems that the org.mnode.ical4j can't be package in the apk when the gradle build.
I have search the answer on the stackoverflow for many days,but it can't works. So,how should I do? Help,please!thanks!
解决方案I re-post the answer of jim.zhang here: (since the first time I view this question, I missed zhang's comment)
Add below configure in build.gradle file.
dexOptions { javaMaxHeapSize "4g" }
这篇关于完成的gradle非零退出值3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!