android project: process finished with non-zero exit value 2

前端 未结 5 802
孤城傲影
孤城傲影 2020-12-17 21:15

I\'m unable to compile my android project. Google and other SO posts tell me it (probably) has something to do with dependencies, but I can\'t find where. Here\'s the error:

相关标签:
5条回答
  • 2020-12-17 21:34

    I have used this command in build.gradle file.

    configurations {
    all*.exclude group: 'com.android.support', module: 'support-v4'
    }
    

    It has resolved this "non-zero-exit-value" and another one 'duplicate entry during packageAllDebugClassesForMultiDex'.

    0 讨论(0)
  • 2020-12-17 21:41

    In my case I write in the build.gradle dependencies from the parse quick guide

    dependencies{
    compile 'com.parse.bolts:bolts-android:1.+'
    compile 'com.parse:parse-android:1.+'
    }
    

    then I replace with

    dependencies {
        compile 'com.parse.bolts:bolts-android:1.+'
        compile fileTree(dir: 'libs', include: 'Parse-*.jar')
    }
    

    Save the changes, restart the android studio and run the project. It worked in my case.

    0 讨论(0)
  • 2020-12-17 21:43

    Android Studio suggests,

    Avoid using + in version numbers can lead to unpredictable and unrepeatable builds.

    + in dependencies lets you pick up automatically the latest available version rather than a specific one, however this is not recommended.

    You may have tested with a slightly different version than what build server used.

    After Removing Plus Sign and Adding a Specific Version problem was solved in my case.

    0 讨论(0)
  • 2020-12-17 21:43

    The date of when this happened to me was 07/08/2016.

    I just got this exact error after updating to the newest android studio.

    I resolved it by updating my java jdk from java jdk 7 to java jdk 8.

    Now my builds work fine. I think the newest version of android studio requires jdk 8…

    0 讨论(0)
  • 2020-12-17 21:52

    This happened for me when I was refactoring some class files to a library project and I had a duplicate name of a class file. So, double check that you do not have any duplicate names.

    0 讨论(0)
提交回复
热议问题