org.gradle.process.internal.ExecException: Process

2019-04-13 18:10发布

问题:

i import one project in my Android studio so my build.gradle file as follows.

build.gradle

apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"

defaultConfig {
    applicationId "pkg.demo"
    minSdkVersion 15
    targetSdkVersion 22
    versionCode 1
    versionName "1.0"
    multiDexEnabled true
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
  }
}

dependencies {
compile 'com.android.support:multidex:1.0.0'
compile files('libs/achartengine-1.1.0.jar')
compile files('libs/apache-mime4j-0.6.jar')
compile files('libs/commons-io-2.4.jar')
compile files('libs/droidText.0.2.jar')
compile files('libs/gson-2.1.jar')
compile files('libs/httpmime-4.0.1.jar')
compile files('libs/itextpdf-5.1.0.jar')
compile files('libs/json_simple-1.1.jar')
compile files('libs/opencsv-2.4.jar')
compile files('libs/ormlite-android-4.48.jar')
compile files('libs/ormlite-core-4.48.jar')
compile files('libs/google-play-services.jar')

compile 'com.android.support:appcompat-v7:22.2.0'
}

When i run above project it gave me error like below

Error:Execution failed for task ':app:dexDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_25\bin\java.exe'' finished with non-zero exit value 3

Any idea how can i solve this problem ?you all suggestion are appreciable

回答1:

In all those dependencies there is one which might be duplicate. Duplicate dependency gives such an error. Try and replace the first line in the dependencies function

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

with

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

I am not sure if this will work but something like this worked for me before. Try and delete dependencies which seem duplicate to you