エラー: タスク ':app:dexDebug' の実行に失敗しました。com.android.ide.common.process.ProcessException 質問する

エラー: タスク ':app:dexDebug' の実行に失敗しました。com.android.ide.common.process.ProcessException 質問する

エラー: タスク ':app:dexDebug' の実行に失敗しました。

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: プロセス 'command 'C:\Program Files\Java\jdk1.8.0_40\bin\java.exe'' がゼロ以外の終了値 2 で終了しました

同様の質問と解決策をすべて検索しましたが、役に立ちませんでした。あなたのような専門家が出てくることを願っています。

プロジェクト コードは Bitbucket にアップロードされました:https://[メールアドレス]/tainule/numad-huizhang.git

モジュールは app と endpoint の 2 つあります。以下は Module:app からの抜粋です。

apply plugin: 'com.android.application'

android {
    compileSdkVersion 21
    buildToolsVersion "21.1.2"

    defaultConfig {
        applicationId "edu.neu.madcourse.huizhang1"
        minSdkVersion 14
        targetSdkVersion 21
        versionCode 3
        versionName "2.1"
//        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

        }
    }
}

dependencies {


    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile "com.android.support:appcompat-v7:21.0.+"
    compile 'com.google.android.gms:play-services:+'
    compile 'com.google.guava:guava:18.0'
    compile 'com.google.code.gson:gson:1.7.2'
    compile 'org.apache.httpcomponents:httpmime:4.4-beta1'
    compile 'org.apache.httpcomponents:httpclient:4.4-beta1'
    compile 'org.apache.httpcomponents:httpcore:4.4-beta1'
    compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.3'
    compile project(path: ':endpoint', configuration: 'android-endpoints')
    compile files('src/main/res/libs/KeyValueAPI.jar')

}

以下はモジュールのエンドポイントからのものです:

buildscript {
    repositories {
        mavenLocal()
        mavenCentral()
    }
    dependencies {
        classpath 'com.google.appengine:gradle-appengine-plugin:1.9.17'
    }
}

repositories {
    mavenCentral();
}

apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'appengine'

sourceCompatibility = 1.7
targetCompatibility = 1.7

dependencies {
    appengineSdk 'com.google.appengine:appengine-java-sdk:1.9.8'
    compile 'com.google.appengine:appengine-endpoints:1.9.8'
    compile 'com.google.appengine:appengine-endpoints-deps:1.9.8'
    compile 'javax.servlet:servlet-api:2.5'
    compile 'com.googlecode.objectify:objectify:4.0b3'
    compile 'com.ganyo:gcm-server:1.0.2'
//        compile 'com.github.fengdai:alertdialogpro-theme-material:0.1.0'

}

appengine {
    downloadSdk = true
    appcfg {
        oauth2 = true
    }
    endpoints {
        getClientLibsOnBuild = true
        getDiscoveryDocsOnBuild = true
    }
}

ベストアンサー1

jar ファイルまたは lib が複数回出現しているようです。

したがって、lib フォルダーから .jar ファイルを削除して、次の操作を実行します。

Build>Rebuild

おすすめ記事