关于android studio编译出错的问题

最近在搞一个android wear项目,之前用的是android studio0.8 beta版,之后用了升级的1.0正式版,因为不能直接升级,我卸了0.8重新装了1.0。重新安装后发现,导入原来的那个android wear项目编译出错了,错误如下:
Information:Gradle tasks [:wear:assembleDebug]
:wear:preBuild
:wear:compileDebugNdk UP-TO-DATE
:wear:preDebugBuild
:wear:checkDebugManifest
:wear:preReleaseBuild
:wear:prepareComAndroidSupportRecyclerviewV72100Library UP-TO-DATE
:wear:prepareComAndroidSupportSupportV132103Library UP-TO-DATE
:wear:prepareComAndroidSupportSupportV42103Library UP-TO-DATE
:wear:prepareComGoogleAndroidGmsPlayServicesBase6587Library UP-TO-DATE
:wear:prepareComGoogleAndroidGmsPlayServicesWearable6587Library UP-TO-DATE
:wear:prepareComGoogleAndroidSupportWearable110Library UP-TO-DATE
:wear:prepareDebugDependencies
:wear:compileDebugAidl UP-TO-DATE
:wear:compileDebugRenderscript UP-TO-DATE
:wear:generateDebugBuildConfig UP-TO-DATE
:wear:generateDebugAssets UP-TO-DATE
:wear:mergeDebugAssets UP-TO-DATE
:wear:generateDebugResValues UP-TO-DATE
:wear:generateDebugResources UP-TO-DATE
:wear:mergeDebugResources UP-TO-DATE
:wear:processDebugManifest UP-TO-DATE
:wear:processDebugResources UP-TO-DATE
:wear:generateDebugSources UP-TO-DATE
:wear:compileDebugJava UP-TO-DATE
:wear:preDexDebug
:wear:dexDebug
UNEXPECTED TOP-LEVEL EXCEPTION:
Error:Execution failed for task ':wear:dexDebug'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
D:\Program Files\Android\sdk\build-tools\21.1.2\dx.bat --dex --no-optimize --output D:\android\workspace\kuaipai_wear\wear\build\intermediates\dex\debug --input-list=D:\android\workspace\kuaipai_wear\wear\build\intermediates\tmp\dex\debug\inputList.txt
Error Code:
2
Output:
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Landroid/support/v7/widget/DefaultItemAnimator$1;
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)
Information:BUILD FAILED
Information:Total time: 36.225 secs
Information:1 error
Information:0 warnings
Information:See complete output in console

很是郁闷啊,换了很多种gradle版本,删了引用的包都不行,顺便说下,我用的包是这些

gradle配置如下:
android {
    compileSdkVersion 20
    buildToolsVersion '21.1.2'

    defaultConfig {
        applicationId 'im.kuaipai'
        minSdkVersion 20
        targetSdkVersion 20
        versionCode 1
        versionName '1.0'
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            debuggable true
        }
    }
    productFlavors {
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    // You must install or update the Support Repository through the SDK manager to use this dependency.
    // You must install or update the Support Repository through the SDK manager to use this dependency.
    compile 'com.google.android.gms:play-services-wearable:6.5.87'
    compile 'com.google.android.support:wearable:1.1.0'
    compile 'com.android.support:support-v13:21.0.3'
}


就剩50分了。。。

你可能感兴趣的:(关于android studio编译出错的问题)