相关疑难解决方法(0)

95
推荐指数
6
解决办法
10万
查看次数

Java.util.zip.ZipException:重复条目:com/google/common/base/FinalizableReference.class

为什么我收到此错误时,我同步Gradle时不会发生,但是当我运行项目时,我收到此错误.

错误:任务':app:transformClassesWithJarMergingForRelease'的执行失败.> com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复条目:com/google/common/base/FinalizableReference.class

我不知道哪个依赖项导致此错误,我的依赖项是.

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.android.support:support-v4:25.3.1'
    compile 'com.android.support:customtabs:25.3.1'
    compile 'com.android.support:cardview-v7:25.3.1'
    compile 'com.android.support:design:25.3.1'
    compile 'com.android.support:percent:25.3.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.facebook.android:facebook-android-sdk:4.19.0'
    compile 'com.google.android.gms:play-services-auth:11.0.0'
    compile 'com.google.android.gms:play-services-location:11.0.0'
    compile 'com.google.android.gms:play-services-maps:11.0.0'
    compile 'com.google.android.gms:play-services-places:11.0.0'
    compile 'com.google.maps.android:android-maps-utils:0.3.4'
    compile 'io.nlopez.smartlocation:library:3.3.1'
    compile 'com.appeaser.sublimenavigationviewlibrary:sublimenavigationviewlibrary:0.0.1'
    compile 'de.hdodenhof:circleimageview:2.1.0'
    compile 'com.android.volley:volley:1.0.0'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.nineoldandroids:library:2.4.0'
    compile 'com.daimajia.slider:library:1.1.5@aar'
    compile 'com.afollestad:sectioned-recyclerview:0.4.1'
    compile 'com.github.medyo:fancybuttons:1.8.3'
    compile 'com.basgeekball:awesome-validation:2.0'
    compile 'com.github.michaelye.easydialog:easydialog:1.4'
    testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
Run Code Online (Sandbox Code Playgroud)

编辑

我认为播放服务依赖导致了这个问题.当我使用10.2.6而不是11.0.0应用程序工作完美时,我只是将dependecies更改为

compile …
Run Code Online (Sandbox Code Playgroud)

android android-gradle-plugin

5
推荐指数
1
解决办法
6964
查看次数

Android studio默认项目失败:错误:无法解决:com.android.support:support-v4:25.2.0

我真的只是第一次启动应用程序开发,当我创建一个新项目时,默认项目将无法构建.我曾尝试在Google和SO上查找这些错误并找到了一些,但他们的解决方案无效.鉴于我根本没有编辑过这些文件,我认为这是Android Studio未正确设置的问题,但无法解决.错误如下:

Error:Failed to resolve: com.android.support:support-v4:25.2.0
Install Repository and sync project
Open File
Show in Project Structure dialog

Error:(23, 24) Failed to resolve: com.android.support.test.espresso:espresso-core:2.2.2
Install Repository and sync project
Show in File
Show in Project Structure dialog

Error:(26, 13) Failed to resolve: com.android.support:appcompat-v7:26.+
Install Repository and sync project
Show in File
Show in Project Structure dialog
Run Code Online (Sandbox Code Playgroud)

它指向的build.gradle文件如下:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.0"
    defaultConfig {
        applicationId "com.extremecomputing.spotzz"
        minSdkVersion 17
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" …
Run Code Online (Sandbox Code Playgroud)

android android-sdk-tools android-studio

4
推荐指数
1
解决办法
9331
查看次数