进程' C:\ Program Files \ Java \ jdk1.7.0_80 \ bin \ java.exe''完成非零退出值2

时间:2016-01-09 04:17:47

标签: android android-studio android-studio-import

我已将eclipse项目导入android studio。当我在工作室创建新项目并运行其工作正常。但是当我运行导入的项目时,我的错误就越来越差了。

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_80\bin\java.exe'' finished with non-zero exit value 2

这是我的bulid.gradle文件

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"
//    useLibrary 'org.apache.http.legacy'

    defaultConfig {
        applicationId "com.edelivery"
        minSdkVersion 11
        targetSdkVersion 23

        multiDexEnabled true
//        compileOptions {
//            sourceCompatibility JavaVersion.VERSION_1_5
//            targetCompatibility JavaVersion.VERSION_1_5
//        }


    }

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

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.1.3'
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
//    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.1.1'
//    compile 'com.android.support:appcompat-v7:22.2.0'
    compile 'com.android.support:design:23.1.1'
    compile 'com.google.android.gms:play-services:8.4.0'
    compile 'com.google.code.gson:gson:2.2.1'

    compile 'org.apache.httpcomponents:httpcore:4.4.1'
    compile 'org.apache.httpcomponents:httpclient:4.5'
    compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
    compile 'com.android.support:multidex:1.0.0'

    compile files('libs/PayPalAndroidSDK-2.9.10.jar')
    compile files('libs/gcm.jar')
}

1 个答案:

答案 0 :(得分:0)

请改变

classpath 'com.android.tools.build:gradle:1.1.3'

  classpath 'com.android.tools.build:gradle:1.5.1'

 classpath 'com.android.tools.build:gradle:2.0.0-alpha3' 

请改变(如果需要)

   distributionUrl=https\://services.gradle.org/distributions/gradle-X.X-all.zip

    distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip

还要考虑升级(如果尚未完成)将Android Studio升级到最新版本

它应该有用。