完成非零退出值3

Sol*_*ell 13 android android-gradle-plugin

我正在尝试运行我的项目,但我不断收到此错误:

错误:任务':app:preDexDebug'的执行失败.com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:进程'命令'/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/bin/java''完成非零退出值3

这是我的傻瓜:

apply plugin: 'com.android.application'

android {
compileSdkVersion 21
buildToolsVersion "21.1.2"

defaultConfig {
    applicationId "com.blume.android"
    minSdkVersion 14
    targetSdkVersion 21
    versionCode 1
    versionName "1.0"
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(path: ':endpoints-backend', configuration: 'android-endpoints')
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.google.android.gms:play-services:6.5.87'
compile project(path: ':cloud-backend', configuration: 'android-endpoints')
compile 'javax.persistence:persistence-api:1.0'
compile project(':endpoints-backend')
}
Run Code Online (Sandbox Code Playgroud)

所有帮助表示赞赏.

小智 57

添加这个:

android {
    // Other stuffs
    dexOptions {
        javaMaxHeapSize "4g"
    }
}
Run Code Online (Sandbox Code Playgroud)

  • 经过大量的解决方案后,最终这个解决方案帮助了我.如果有的话,我将不得不检查是否存在缺陷.谢谢. (2认同)

小智 27

我改变了

" 编译 fileTree(dir:'libs',包括:['*.jar'])"

" 提供了 fileTree(dir:'libs',包括:['*.jar'])".

它解决了我的问题


Uda*_*yak 6

将HEAP尺寸增加至2g或4g.

android {
        defaultConfig {}

        dexOptions {
              javaMaxHeapSize "4g"
        }

        packagingOptions {
        }

        buildTypes {
        }
   }
Run Code Online (Sandbox Code Playgroud)