错误:程序类型已存在:com.google.android.gms.internal.measurement.zzdz

4

我看到了几篇关于这个主题的类似帖子,但是没有一个适用于我的情况。根据那些帖子的内容,我已经分析出这很可能是由于我的Firebase依赖之一引起的,但我不确定如何解决这个问题。清理、使无效等操作已经完成,所有的依赖项都已经更新到最新版本。以下是我的gradle文件:

Project:

buildscript {

    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
        classpath'com.google.gms:google-services:4.1.0'


    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}

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

应用:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "org.andrewedgar.theo"
        minSdkVersion 19
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }
    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:28.0.0'
    implementation 'com.android.support:support-v13:28.0.0'
    implementation 'com.android.support:cardview-v7:28.0.0'
    implementation 'com.android.support:customtabs:28.0.0'
    implementation 'com.android.support:design:28.0.0'
    implementation 'com.android.support:support-media-compat:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.android.support:recyclerview-v7:28.0.0'

    implementation 'com.android.support:multidex:1.0.3'
    implementation 'android.arch.paging:runtime:1.0.1'

    implementation 'org.jetbrains:annotations:16.0.2'

    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.google.android.gms:play-services-auth:16.0.1'
    implementation 'com.google.android.gms:play-services-ads:17.0.0'
    implementation 'com.google.android.gms:play-services-places:16.0.0'
    implementation 'com.google.android.gms:play-services-maps:16.0.0'

    implementation 'com.google.firebase:firebase-core:16.0.5'
    implementation 'com.firebaseui:firebase-ui-auth:4.2.0'
    implementation 'com.google.firebase:firebase-firestore:17.1.2'
    implementation 'com.firebaseui:firebase-ui-firestore:4.1.0'
    implementation 'com.google.firebase:firebase-auth:16.0.5'
    implementation 'com.google.firebase:firebase-ads:17.0.0'
    implementation 'com.crashlytics.sdk.android:crashlytics:2.9.5'
    implementation 'com.google.firebase:firebase-messaging:17.3.4'
}


apply plugin: 'com.google.gms.google-services'
1个回答

3
尝试将 Firebase 核心库降级至以下版本:
implementation 'com.google.firebase:firebase-core:16.0.4'

如果无法解决问题,可以尝试降级其他firebase库。在我的情况下,也是这样:

implementation 'com.google.firebase:firebase-dynamic-links:16.1.2'

1
这使我能够继续工作,但希望能找到一种不需要人们使用旧版本的解决方案。谢谢。 - andrewedgar
是的,'com.google.firebase:firebase-core:16.0.5' 引起问题,而'com.google.firebase:firebase-core:16.0.4'则可以正常工作。 - user924
@user924 我的应用程序中有'com.google.firebase:firebase-core:16.0.4',但问题仍然存在。 - Mohammedsalim Shivani

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接