代码之家  ›  专栏  ›  技术社区  ›  jonasxd360

无法解析:firebase common

  •  3
  • jonasxd360  · 技术社区  · 6 年前

    尝试添加firebase auth时出现此错误

    无法解析:firebase common

    build.gradle公司

    apply plugin: 'com.android.application'
    
    android {
    compileSdkVersion 27
    buildToolsVersion '27.0.3'
    defaultConfig {
    ...
    }
    
    dependencies {
    implementation 'com.google.firebase:firebase-core:15.0.2'
    implementation 'com.google.firebase:firebase-messaging:15.0.2'
    implementation 'com.google.firebase:firebase-crash:15.0.2'
    implementation 'com.google.firebase:firebase-appindexing:15.0.1'
    implementation 'com.google.firebase:firebase-invites:15.0.1'
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    implementation 'com.google.firebase:firebase-firestore:16.0.0'
    implementation 'com.firebaseui:firebase-ui-auth:4.0.0'
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.0'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.android.support:support-v4:27.1.1'
    implementation 'com.android.support:support-vector-drawable:27.1.1'
    implementation 'com.android.support:recyclerview-v7:27.1.1'
    implementation 'com.android.support:cardview-v7:27.1.1'
    implementation 'com.google.code.gson:gson:2.8.2'
    testImplementation 'junit:junit:4.12'
     }
     // Add to the bottom of the file - this is for Google Firebase
     apply plugin: 'com.google.gms.google-services'
    

    直到我添加了“实现”的用户界面,所有的东西都会起作用。

    谢谢你的帮助!

    1 回复  |  直到 6 年前
        1
  •  3
  •   Peter Haddad    6 年前

    如果您使用的是FireBaseUI版本4.0.0,那么它还需要与FireBase库版本兼容。

    4.0.0版FireBaseUI具有以下依赖项版本:

         Library        Version
    firebase-auth       16.0.1
    play-services-auth  15.0.1
    firebase-database   16.0.1
    firebase-firestore  17.0.1
    firebase-storage    16.0.1
    

    更多信息请点击此处:

    https://github.com/firebase/FirebaseUI-Android#compatibility-with-firebase--google-play-services-libraries

    同时升级:

    implementation 'com.google.firebase:firebase-core:15.0.2'
    implementation 'com.google.firebase:firebase-messaging:15.0.2'
    implementation 'com.google.firebase:firebase-crash:15.0.2'
    implementation 'com.google.firebase:firebase-appindexing:15.0.1'
    implementation 'com.google.firebase:firebase-invites:15.0.1'
    

    以下内容:

    implementation 'com.google.firebase:firebase-core:16.0.1'
    implementation 'com.google.firebase:firebase-messaging:17.0.0'
    implementation 'com.google.firebase:firebase-crash:16.0.1'
    implementation 'com.google.firebase:firebase-appindexing:16.0.1'
    implementation 'com.google.firebase:firebase-invites:16.0.1'
    

    检查这个:

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