Android Studio中Firebase依赖项的重复类错误

时间:2020-05-03 18:01:38

标签: android firebase firebase-realtime-database firebase-authentication

build.gradle:

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

android {
    compileSdkVersion 29
    buildToolsVersion "29.0.3"

    defaultConfig {
        applicationId "com.cs.mapstutorial"
        minSdkVersion 28
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
            multiDexKeepFile file('multidex-config.txt')
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'com.google.android.gms:play-services-maps:17.0.0'
    implementation 'com.google.firebase:firebase-database:19.3.0'
    testImplementation 'junit:junit:4.13'
    implementation 'com.google.firebase:firebase-auth:19.3.1'
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.google.maps:google-maps-services:0.11.0'
    implementation 'org.slf4j:slf4j-simple:1.7.25'
    implementation 'com.github.ar-android:DrawRouteMaps:1.0.0'
}

输出:

Duplicate class com.google.firebase.auth.AuthCredential found in modules jetified-firebase-auth-19.3.1-runtime.jar (com.google.firebase:firebase-auth:19.3.1) and jetified-firebase-auth-common-9.6.1-runtime.jar (com.google.firebase:firebase-auth-common:9.6.1)
Duplicate class com.google.firebase.auth.EmailAuthCredential found in modules jetified-firebase-auth-19.3.1-runtime.jar (com.google.firebase:firebase-auth:19.3.1) and jetified-firebase-auth-common-9.6.1-runtime.jar (com.google.firebase:firebase-auth-common:9.6.1)
Duplicate class com.google.firebase.auth.EmailAuthProvider found in modules jetified-firebase-auth-19.3.1-runtime.jar (com.google.firebase:firebase-auth:19.3.1) and jetified-firebase-auth-common-9.6.1-runtime.jar (com.google.firebase:firebase-auth-common:9.6.1)
Duplicate class com.google.firebase.auth.FacebookAuthCredential found in modules jetified-firebase-auth-19.3.1-runtime.jar (com.google.firebase:firebase-auth:19.3.1) and jetified-firebase-auth-common-9.6.1-runtime.jar (com.google.firebase:firebase-auth-common:9.6.1)
Duplicate class com.google.firebase.auth.FacebookAuthProvider found in modules jetified-firebase-auth-19.3.1-runtime.jar (com.google.firebase:firebase-auth:19.3.1) and jetified-firebase-auth-common-9.6.1-runtime.jar (com.google.firebase:firebase-auth-common:9.6.1)
Duplicate class com.google.firebase.auth.FirebaseAuthProvider found in modules jetified-firebase-auth-19.3.1-runtime.jar (com.google.firebase:firebase-auth:19.3.1) and jetified-firebase-auth-common-9.6.1-runtime.jar (com.google.firebase:firebase-auth-common:9.6.1)
Duplicate class com.google.firebase.auth.GithubAuthCredential found in modules jetified-firebase-auth-19.3.1-runtime.jar (com.google.firebase:firebase-auth:19.3.1) and jetified-firebase-auth-common-9.6.1-runtime.jar (com.google.firebase:firebase-auth-common:9.6.1)
Duplicate class com.google.firebase.auth.GithubAuthProvider found in modules jetified-firebase-auth-19.3.1-runtime.jar (com.google.firebase:firebase-auth:19.3.1) and jetified-firebase-auth-common-9.6.1-runtime.jar (com.google.firebase:firebase-auth-common:9.6.1)
Duplicate class com.google.firebase.auth.GoogleAuthCredential found in modules jetified-firebase-auth-19.3.1-runtime.jar (com.google.firebase:firebase-auth:19.3.1) and jetified-firebase-auth-common-9.6.1-runtime.jar (com.google.firebase:firebase-auth-common:9.6.1)
Duplicate class com.google.firebase.auth.GoogleAuthProvider found in modules jetified-firebase-auth-19.3.1-runtime.jar (com.google.firebase:firebase-auth:19.3.1) and jetified-firebase-auth-common-9.6.1-runtime.jar (com.google.firebase:firebase-auth-common:9.6.1)
Duplicate class com.google.firebase.auth.TwitterAuthCredential found in modules jetified-firebase-auth-19.3.1-runtime.jar (com.google.firebase:firebase-auth:19.3.1) and jetified-firebase-auth-common-9.6.1-runtime.jar (com.google.firebase:firebase-auth-common:9.6.1)
Duplicate class com.google.firebase.auth.TwitterAuthProvider found in modules jetified-firebase-auth-19.3.1-runtime.jar (com.google.firebase:firebase-auth:19.3.1) and jetified-firebase-auth-common-9.6.1-runtime.jar (com.google.firebase:firebase-auth-common:9.6.1)
Duplicate class com.google.firebase.auth.UserInfo found in modules jetified-firebase-auth-19.3.1-runtime.jar (com.google.firebase:firebase-auth:19.3.1) and jetified-firebase-auth-common-9.6.1-runtime.jar (com.google.firebase:firebase-auth-common:9.6.1)
Duplicate class com.google.firebase.auth.UserProfileChangeRequest found in modules jetified-firebase-auth-19.3.1-runtime.jar (com.google.firebase:firebase-auth:19.3.1) and jetified-firebase-auth-common-9.6.1-runtime.jar (com.google.firebase:firebase-auth-common:9.6.1)
Duplicate class com.google.firebase.auth.UserProfileChangeRequest$Builder found in modules jetified-firebase-auth-19.3.1-runtime.jar (com.google.firebase:firebase-auth:19.3.1) and jetified-firebase-auth-common-9.6.1-runtime.jar (com.google.firebase:firebase-auth-common:9.6.1)
Duplicate class com.google.firebase.auth.zza found in modules jetified-firebase-auth-19.3.1-runtime.jar (com.google.firebase:firebase-auth:19.3.1) and jetified-firebase-auth-common-9.6.1-runtime.jar (com.google.firebase:firebase-auth-common:9.6.1)

如何清除此错误? 另外,我尝试了其他类似问题中所述的exclude:group方法,但这也不起作用。另外,androidX和jetifier = true。而且,我还尝试了清理和重建项目。还要从.gradle文件夹中删除缓存,但无济于事。

0 个答案:

没有答案