android - 更新后 Firebase 重复类错误

标签 android firebase

一切都适用于 com.google.firebase:firebase-core:16.0.4 版本,但是有一个更新的版本,当我将它更新到 com.google.firebase:firebase- core:16.0.5 在 gradle 中然后运行我的应用程序出现此错误

   org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
    Caused by: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: C:\Users\User\AndroidStudioProjects\AppName\app\build\intermediates\transforms\dexBuilder\debug\0.jar
Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.
    Program type already present: com.google.android.gms.internal.measurement.zzdz

这是我的 gradle 文件:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.app.test"
        vectorDrawables.useSupportLibrary = true
        minSdkVersion 17
        targetSdkVersion 28
        multiDexEnabled true
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    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:customtabs:28.0.0'
    implementation 'com.android.support:support-media-compat:28.0.0'
    implementation 'com.android.support:support-v4:28.0.0'
    implementation 'com.android.support:cardview-v7:28.0.0'
    implementation 'com.android.support:animated-vector-drawable:28.0.0'
    implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.android.support:design:28.0.0'
    implementation 'com.android.support:recyclerview-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation "com.android.support:support-compat:28.0.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:design:28.0.0'
    implementation 'com.google.firebase:firebase-core:16.0.4'
    implementation 'com.google.firebase:firebase-auth:16.0.5'
    implementation 'com.google.firebase:firebase-ads:17.0.0'
    implementation 'com.google.firebase:firebase-firestore:17.1.2'
    implementation 'com.crashlytics.sdk.android:crashlytics:2.9.5'
}

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

最佳答案

最新的firebase-core是16.0.4版本,您可以在以下链接查看各个依赖的最新版本:

https://firebase.google.com/support/release-notes/android

关于android - 更新后 Firebase 重复类错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53133792/

相关文章:

android - Phonegap Android HTML5 音频播放器延迟

Android ROOM 持久化复杂对象

android - 验证您的 APK 配置

firebase realtimeDB 同时连接?

android - 使用混淆器删除 MediaPlayer 的日志调用

android - Google TV 中的 channel 列表未显示 channel

android - FirebaseInstanceId - 每个 Firebase "App"或 Android 应用程序唯一?

firebase - Firestore查询无法获取文档

ios - 我传递的变量不会仅获取视频用户 ID 和个人资料图像 (Swift 3)

javascript - Firebase 云功能总是超时