Android Studio:错误:构建项目时任务':app:dexDebug'的执行失败

时间:2015-05-14 00:08:38

标签: android android-studio

我第一次使用Android Studio,导入项目后出现了以下错误(以前这是一个我也有问题的日食项目。)

以下是给出的信息:

   Error:Execution failed for task ':xink:dexDebug'.
  

com.android.ide.common.internal.LoggedErrorException:无法运行命令:       C:\ Users \ user \ AppData \ Local \ Android \ sdk \ build-tools \ 21.1.2 \ dx.bat --dex --no-optimize --output E:\ xink App \ Xink \ xink \ build \ intermediates \ dex \ debug --input-list = E:\ xink App \ Xink \ xink \ build \ intermediates \ tmp \ _dex \ debug \ inputList.txt   错误代码:       2   输出:       意外的顶级例外情况:       com.android.dex.DexIndexOverflowException:方法ID不在[0,0xffff]中:65536           在com.android.dx.merge.DexMerger $ 6.updateIndex(DexMerger.java:502)           在com.android.dx.merge.DexMerger $ IdMerger.mergeSorted(DexMerger.java:277)           在com.android.dx.merge.DexMerger.mergeMethodIds(DexMerger.java:491)           在com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:168)           在com.android.dx.merge.DexMerger.merge(DexMerger.java:189)           在com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454)           在com.android.dx.command.dexer.Main.runMonoDex(Main.java:303)           在com.android.dx.command.dexer.Main.run(Main.java:246)           在com.android.dx.command.dexer.Main.main(Main.java:215)           在com.android.dx.command.Main.main(Main.java:106)

app build.gradle是这样的:

    apply plugin: 'com.android.application'

    android {
        compileSdkVersion 19
        buildToolsVersion "21.1.2"

        defaultConfig {
            applicationId "com.vog.xink"
            minSdkVersion 14
            targetSdkVersion 21
        }

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

    dependencies {
    compile project(':library')
    compile project(':facebook')
    compile project(':swipecard')

    compile files('libs/android-query-full.0.26.7.jar')
    compile files('libs/httpmime-4.1.1.jar')


    compile files('libs/google-api-client-1.10.3-beta.jar')
    compile files('libs/google-http-client-1.10.3-beta.jar')
    compile files('libs/google-api-client-android2-1.10.3-beta.jar')
    compile files('libs/google-http-client-android2-1.10.3-beta.jar')

    compile files('libs/google-oauth-client-1.10.1-betar.jar')
    compile files('libs/jackson-core-asl-1.9.4.jar')
    compile files('libs/jsr305-1.3.9.jar')


    compile 'com.loopj.android:android-async-http:1.4.6'
    compile 'com.etsy.android.grid:library:1.0.5'
    compile 'com.android.support:support-v4:21.0.3'
    compile 'com.google.android.gms:play-services:6.5.87'
    compile 'com.jpardogo.materialtabstrip:library:1.0.6'
    compile 'com.crittercism:crittercism-android-agent:+'
    compile 'org.jsoup:jsoup:1.7.2'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.google.code.gson:gson:2.3'
    compile 'com.androidmapsextensions:android-maps-extensions:2.2.0'
    compile 'com.google.guava:guava:18.0'

}

1 个答案:

答案 0 :(得分:0)

您可能不止一次包含同一个库。尝试只包含一个google-api-client和一个google-http-client