通过按返回此错误来运行应用程序:
错误:任务执行失败“:myproject:dexDebug”。com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process‘org.gradle.process.internal.ExecException 'C:\Program \Java\jdk1.8.0_51\bin\java.exe’‘以非零退出值3完成
我的项目有lib facebook和wheellib。我意识到Android需要很长时间来处理Gradle,然后显示这个错误,应用程序永远不会启动(运行)
我的等级:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId 'br.com.myproject'
minSdkVersion 19
targetSdkVersion 23
multiDexEnabled = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile project(':facebookSDK')
compile project(':wheellib')
compile files('libs/comscore.jar')
compile files('libs/FlurryAnalytics-5.5.0.jar')
compile 'com.android.support:support-v4:23.1.0'
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.google.code.gson:gson:2.3'
compile 'com.squareup.picasso:picasso:2.3.2'
compile 'joda-time:joda-time:2.4'
compile 'com.google.android.gms:play-services:8.3.0'
compile 'com.squareup.okhttp:okhttp:2.5.0'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.5.0'
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'com.android.support:multidex:1.0.1'
compile 'com.google.android.gms:play-services-ads:8.3.0'
compile 'com.google.android.gms:play-services-identity:8.3.0'
compile 'com.google.android.gms:play-services-gcm:8.3.0'
}发布于 2015-11-12 17:42:41
我改变了我的build.gradle和工作!添加了dexOptions:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId 'br.com.myproject'
minSdkVersion 19
targetSdkVersion 23
multiDexEnabled = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
compileOptions {
//noinspection GroovyAssignabilityCheck
sourceCompatibility JavaVersion.VERSION_1_7
//noinspection GroovyAssignabilityCheck
targetCompatibility JavaVersion.VERSION_1_7
}
dexOptions {
incremental true
javaMaxHeapSize "4g"
}
}
dependencies {
compile project(':facebookSDK')
compile project(':wheellib')
compile files('libs/comscore.jar')
compile files('libs/FlurryAnalytics-5.5.0.jar')
compile 'com.android.support:support-v4:23.1.0'
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.google.code.gson:gson:2.3'
compile 'com.squareup.picasso:picasso:2.3.2'
compile 'joda-time:joda-time:2.4'
compile 'com.google.android.gms:play-services:8.3.0'
compile 'com.squareup.okhttp:okhttp:2.5.0'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.5.0'
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'com.android.support:multidex:1.0.1'
compile 'com.google.android.gms:play-services-ads:8.3.0'
compile 'com.google.android.gms:play-services-identity:8.3.0'
compile 'com.google.android.gms:play-services-gcm:8.3.0'
}发布于 2015-11-12 15:41:16
您必须在终端上运行此命令:
your-project-directory:$> gradle build --info --stacktrace 然后,您将看到task任务失败的确切时刻。
我认为问题在于,您可能面临64k的方法限制。
发布于 2015-11-12 15:48:59
我今天也遇到了这个问题,就是在SDK中只需要JDK 1_7!我把它加在gradle里
compileOptions {
//noinspection GroovyAssignabilityCheck
sourceCompatibility JavaVersion.VERSION_1_7
//noinspection GroovyAssignabilityCheck
targetCompatibility JavaVersion.VERSION_1_7
}然后将计算机上的HOME_JAVA更改为JDK版本的1_7,并将结构中的Java更改为1_7,这就是我所要做的。您可以检查所有JDK需求的兼容性,或者也可能是64+方法问题。
https://stackoverflow.com/questions/33675210
复制相似问题