错误:任务':dexDebug'的执行失败。 >

时间:2016-06-07 12:30:19

标签: android build.gradle

在我添加编译'com.google.android.gms:play-services-location:9.0.2'后出现此错误。 错误:任务':dexDebug'执行失败。

  

com.android.ide.common.process.ProcessException:org.gradle.process.internal.ExecException:进程'命令'C:\ Program Files \ Java \ jdk1.8.0_60 \ bin \ java.exe''已完成具有非零退出值2.

`

apply plugin: 'com.android.application'

    buildscript {
        repositories {
            jcenter()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:1.3.0'
            classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
            classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2'
        }
    }


    dependencies {
        compile fileTree(include: '*.jar', dir: 'libs')
        compile project(':android-support-v7-appcompat')
        compile project(':android-support-v7-CardView')
        compile project(':Material_ContextMenu_Library')
        compile project(':Material_FloatButton_LibraryPrem')
        compile project(':ViewPager_AutoSlider_Library')
        compile project(':google-play-services_lib')
        compile project(':Material_Dialog_Library')
        compile project(':FacebookSDK_Shopsy')
        compile 'com.google.android.gms:play-services-location:9.0.2'
    }




    android {
        compileSdkVersion 21
        buildToolsVersion "21.1.2"
        enforceUniquePackageName = false
        defaultConfig {
            applicationId "in.directcreate"
            minSdkVersion 14
            targetSdkVersion 22
        }



        packagingOptions {
            exclude 'META-INF/LICENSE.txt'
            exclude 'META-INF/NOTICE.txt'
            exclude 'META-INF/DEPENDENCIES'
        }

        sourceSets {
            main {
                manifest.srcFile 'AndroidManifest.xml'
                java.srcDirs = ['src']
                resources.srcDirs = ['src']
                aidl.srcDirs = ['src']
                renderscript.srcDirs = ['src']
                res.srcDirs = ['res']
                assets.srcDirs = ['assets']
            }

            // Move the tests to tests/java, tests/res, etc...
            instrumentTest.setRoot('tests')

            // Move the build types to build-types/<type>
            // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
            // This moves them out of them default location under src/<type>/... which would
            // conflict with src/ being used by the main source set.
            // Adding new build types or product flavors should be accompanied
            // by a similar customization.
            debug.setRoot('build-types/debug')
            release.setRoot('build-types/release')
        }
    }

完整信息:

Information:Gradle tasks [:assembleDebug]
WARNING [Project: :] Support for libraries with same package name is deprecated and will be removed in a future release.
:preBuild UP-TO-DATE
:preDebugBuild UP-TO-DATE
:checkDebugManifest
:preReleaseBuild UP-TO-DATE
:Material_ContextMenu_Library:compileLint
:Material_ContextMenu_Library:copyReleaseLint UP-TO-DATE
:Material_ContextMenu_Library:mergeReleaseProguardFiles UP-TO-DATE
:Material_ContextMenu_Library:preBuild UP-TO-DATE
:Material_ContextMenu_Library:preReleaseBuild UP-TO-DATE
:Material_ContextMenu_Library:checkReleaseManifest
:Material_ContextMenu_Library:preDebugAndroidTestBuild UP-TO-DATE
:Material_ContextMenu_Library:preDebugBuild UP-TO-DATE
:Material_ContextMenu_Library:preDebugUnitTestBuild UP-TO-DATE
:Material_ContextMenu_Library:preReleaseUnitTestBuild UP-TO-DATE
:Material_Dialog_Library:compileLint
:google-play-services_lib:compileLint
:google-play-services_lib:copyReleaseLint UP-TO-DATE
:google-play-services_lib:mergeReleaseProguardFiles UP-TO-DATE
:google-play-services_lib:preBuild UP-TO-DATE
:google-play-services_lib:preReleaseBuild UP-TO-DATE
:google-play-services_lib:checkReleaseManifest
:google-play-services_lib:prepareReleaseDependencies
:google-play-services_lib:compileReleaseAidl UP-TO-DATE
:google-play-services_lib:compileReleaseRenderscript UP-TO-DATE
:google-play-services_lib:generateReleaseBuildConfig UP-TO-DATE
:google-play-services_lib:generateReleaseAssets UP-TO-DATE
:google-play-services_lib:mergeReleaseAssets UP-TO-DATE
:google-play-services_lib:generateReleaseResValues UP-TO-DATE
:google-play-services_lib:generateReleaseResources UP-TO-DATE
:google-play-services_lib:packageReleaseResources UP-TO-DATE
:google-play-services_lib:processReleaseManifest UP-TO-DATE
:google-play-services_lib:processReleaseResources UP-TO-DATE
:google-play-services_lib:generateReleaseSources UP-TO-DATE
:google-play-services_lib:processReleaseJavaRes UP-TO-DATE
:google-play-services_lib:compileReleaseJavaWithJavac
:google-play-services_lib:packageReleaseJar UP-TO-DATE
:google-play-services_lib:compileReleaseNdk UP-TO-DATE
:google-play-services_lib:packageReleaseJniLibs UP-TO-DATE
:google-play-services_lib:packageReleaseLocalJar UP-TO-DATE
:google-play-services_lib:packageReleaseRenderscript UP-TO-DATE
:google-play-services_lib:bundleRelease UP-TO-DATE
:compileDebugAidl UP-TO-DATE
:compileDebugRenderscript UP-TO-DATE
:generateDebugBuildConfig UP-TO-DATE
:generateDebugAssets UP-TO-DATE
:mergeDebugAssets UP-TO-DATE
:generateDebugResValues UP-TO-DATE
:generateDebugResources UP-TO-DATE
:mergeDebugResources UP-TO-DATE
:processDebugManifest UP-TO-DATE
:processDebugResources UP-TO-DATE
:generateDebugSources UP-TO-DATE
:processDebugJavaRes UP-TO-DATE
:compileDebugJavaWithJavac UP-TO-DATE
:compileDebugNdk UP-TO-DATE
:compileDebugSources UP-TO-DATE
:preDexDebug UP-TO-DATE
:dexDebug
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Landroid/support/annotation/AnimRes;
    at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
    at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
    at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
    at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
    at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
    at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454)
    at com.android.dx.command.dexer.Main.runMonoDex(Main.java:303)
    at com.android.dx.command.dexer.Main.run(Main.java:246)
    at com.android.dx.command.dexer.Main.main(Main.java:215)
    at com.android.dx.command.Main.main(Main.java:106)
Error:Execution failed for task ':dexDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_60\bin\java.exe'' finished with non-zero exit value 2
Information:BUILD FAILED
Information:Total time: 40.842 secs
Information:1 error
Information:0 warnings
Information:See complete output in console

0 个答案:

没有答案