Finished with Non Zero Exit Value 3

泄露秘密 提交于 2019-11-27 20:14:13

I just change

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

to

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

It resolved my problem

张立宾

add this:

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

Increased the HEAP size to 2g or 4g. Filename: build.gradle

android {
        defaultConfig {}

        dexOptions {
              javaMaxHeapSize "4g"
        }

        packagingOptions {
        }

        buildTypes {
        }
   }

Steps:

1.Go to your app build.gradle

2.include the following: dexOptions { javaMaxHeapSize "4g" }

Yogesh Borhade

1. Please check the Below Code For 1. When i am Using Firebase(com.google.firebase:firebase-messaging:10.0.1) and GMS (compile 'com.google.android.gms:play-services:10.0.1' ) then it gives me error

 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. so i have added this line in gradle File `
defaultConfig { multiDexEnabled true } and in dependacies

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

dexOptions {

        javaMaxHeapSize "2g"
    }

3.so Code Working fine For Updated Version. and not working for Kitkat 4.4.2 device reason is Appcompact, Material Design not Working on that.So i have added below line code in gradle file

  aaptOptions {
    additionalParameters "--no-version-vectors"
}

4. And also have dome some changes with menifest file in

 <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 Check the my Gradle file which working fine For Me you need to do changes .

  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'

I am just change

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

To

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!