按返回此错误运行应用程序:
错误:任务':myproject:dexDebug'的执行失败。 com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:进程'命令'C:\ Program Files \ Java \ jdk1.8.0_51 \ bin \ java.exe''以非完成零退出值3
我的项目有lib facebook sdk和wheellib。 我意识到Android Studio很长时间处理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'
}
答案 0 :(得分:0)
您必须在终端上运行此命令:
your-project-directory:$> gradle build --info --stacktrace
然后你会看到te gradle任务失败的确切时刻。
我认为问题在于您可能面临64k方法限制。
答案 1 :(得分:0)
我今天也有这个问题,它只在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,并将Android Studios项目结构中的Java版本更改为1_7,这就是我所做的一切。 您可能只是检查所有JDK要求的兼容性,或者也可能是64+方法问题...
答案 2 :(得分:0)
我改变了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'
}