首页 > 解决方案 > Android 重复库 - com.google.android.gms.internal.measurement.zzfs

问题描述

我遇到了这个问题:

Error: Program type already present: com.google.android.gms.internal.measurement.zzfs

它在 11 月 9 日运行良好,我发布了一个新版本,但现在我收到了这个错误。我不知道哪个库导致这个问题这里是我的 gradles..

应用程序模块 gradle:

apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

android {
    compileSdkVersion 26
    defaultConfig {
        applicationId ""
        minSdkVersion 21
        targetSdkVersion 26
        versionCode 40
        versionName "1.2.2"
        testInstrumentationRunner "android.support.test.runner.AndroidJsUnitRunner"
    }
    allprojects {
        repositories {
            jcenter()
            google()
        }
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support:cardview-v7:26.1.0'
    implementation 'com.android.support:recyclerview-v7:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    implementation 'com.google.android:flexbox:1.0.0'
    implementation 'com.android.support:design:26.1.0'
    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation 'com.squareup.retrofit2:retrofit:2.3.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
    implementation 'com.squareup.okhttp3:okhttp:3.4.1'
    implementation 'com.squareup.okhttp3:logging-interceptor:3.4.1'
    implementation 'com.facebook.android:facebook-login:[4,5)'
    implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.15'
    implementation 'com.google.android.gms:play-services-wallet:16.0.1'
    implementation 'com.google.android.gms:play-services-location:16.0.0'
    implementation 'com.google.android.gms:play-services-auth:16.0.1'
    implementation 'io.card:android-sdk:5.5.1'
    implementation 'com.google.firebase:firebase-core:16.0.4'
    implementation 'com.google.firebase:firebase-messaging:17.3.4'
    implementation 'com.firebase:firebase-jobdispatcher:0.8.5'
    implementation 'com.crashlytics.sdk.android:crashlytics:2.9.5'
    implementation 'com.facebook.android:audience-network-sdk:5.1.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

    implementation 'com.android.support:gridlayout-v7:26.1.0'
    implementation 'com.smartyads:ad-container:0.4.6'
}

apply plugin: 'com.google.gms.google-services'

这是项目基础 gradle:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

    repositories {
        google()
        jcenter()
        maven {
            url 'https://maven.fabric.io/public'
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'


        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        classpath 'com.google.gms:google-services:4.2.0'
        classpath 'io.fabric.tools:gradle:1.25.4'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven { url "https://jitpack.io" }
        maven { url "https://dl.bintray.com/smartyads/maven/" }
        maven {
            url 'https://maven.google.com/'
        }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

如您所见,我正在使用 gms 组、firebase 和 facebook 受众网络的最新 sdk 版本。但是,我仍然遇到问题。

thisthis可能重复,但我无法从这些线程中解决此问题。

标签: androidfirebasesdk

解决方案


推荐阅读