以非零退出值 3 完成

Finished with Non Zero Exit Value 3

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

Error:Execution failed for task ':app:preDexDebug'. com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/bin/java'' finished with non-zero exit value 3

这是我的 gradle:

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')
}

感谢所有帮助。

我只是改

"compile fileTree(dir: 'libs', include: ['*.jar'])"

"provided fileTree(dir: 'libs', include: ['*.jar'])".

它解决了我的问题

添加这个:

android {
    // Other stuffs
    dexOptions {
        javaMaxHeapSize "4g"
    }
}

将 HEAP 大小增加到 2g 或 4g。 文件名:build.gradle

android {
        defaultConfig {}

        dexOptions {
              javaMaxHeapSize "4g"
        }

        packagingOptions {
        }

        buildTypes {
        }
   }

我只是零钱

"compile fileTree(dir: 'libs', include: ['*.jar'])"

提供的文件树(目录:'libs',包括:['*.jar'])

步骤:

1.Go 到您的应用 build.gradle

2.include 以下内容: dex选项 { javaMaxHeapSize "4g" }

1.请检查以下代码 1.当我使用 Firebase(com.google.firebase:firebase-messaging:10.0.1) 和 GMS (编译'com.google.android.gms:play-services:10.0.1' ) 然后它给我错误

 Error:Execution failed for task ':app:preDexDebug'. com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/bin/java'' finished with non-zero exit value 3

2。所以我在 gradle 文件 中添加了这一行 `
默认配置 { multiDexEnabled 真 } 并且依赖

compile 'com.android.support:multidex:1.0.0'

dexOptions {

        javaMaxHeapSize "2g"
    }

3.so 更新版本的代码工作正常。并且不适用于 Kitkat 4.4.2 设备原因是 Appcompact,Material 设计不适用于 that.So 我在 gradle 文件

中添加了以下行代码
  aaptOptions {
    additionalParameters "--no-version-vectors"
}

4.

中的 menifest 文件也有一些变化
 <application
        android:name="android.support.multidex.MultiDexApplication"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">

5.Please 检查我的 Gradle 文件,它工作正常对我来说,你需要做一些改变。

  apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "25.0.2"


    defaultConfig {
        applicationId "com.xyz.projectName"
        minSdkVersion 16
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    dexOptions {
        //if 2g or 4g
        javaMaxHeapSize "2g"
    }
    // important to run code on kitkat
    aaptOptions {
        additionalParameters "--no-version-vectors"
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    // multidex
    compile 'com.android.support:multidex:1.0.0'


    compile 'com.android.support:appcompat-v7:25.1.0'
    compile 'com.android.support:design:25.1.0'
    compile 'com.android.support:recyclerview-v7:25.1.0'

    // ImageLoader
    compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'

    // Map
    compile 'com.google.android.gms:play-services:10.0.1'
    compile 'com.google.maps.android:android-maps-utils:0.3+'

    // Spinner
    compile 'com.jaredrummler:material-spinner:1.1.0'

    // Volley
    compile 'com.android.volley:volley:1.0.0'

    //Firebase
    compile 'com.google.firebase:firebase-messaging:10.0.1'
    compile 'com.google.firebase:firebase-core:10.0.1'

    //CropImage
    compile project(':CropImage')

}
apply plugin: 'com.google.gms.google-services'