【问题标题】:firebaseUI dependency not matching with the firebase version 15.0.0firebaseUI 依赖项与 firebase 版本 15.0.0 不匹配
【发布时间】:2018-09-24 02:49:07
【问题描述】:

firebaseUI 依赖项与 firebase 版本 15.0.0 不匹配实际上发生的情况是,当我包含 firebaseUI 依赖项时,android studio 显示某种与 values.xml 文件相关的错误。我已经链接了下面的错误图片,当我删除该行时一切正常,那么就没有错误了。

   The code for the entire gradle file is given below:

       apply plugin: 'com.android.application'
       repositories {
            mavenLocal()
            flatDir {
                dirs 'libs'
            }
            maven { url "https://maven.google.com" }

        }
            android {
            compileSdkVersion 24
            buildToolsVersion '26.0.2'
          defaultConfig {
                applicationId "com.google.firebase.udacity.friendlychat"
                minSdkVersion 16
                targetSdkVersion 24
                versionCode 1
                versionName "1.0"
                resConfigs "en"
            }
            buildTypes {
                release {
                    minifyEnabled false
                    proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
                }
            }
            packagingOptions {
                exclude 'META-INF/LICENSE'
                exclude 'META-INF/LICENSE-FIREBASE.txt'
                exclude 'META-INF/NOTICE'
            }
        }
        dependencies {
            compile fileTree(dir: 'libs', include: ['*.jar'])
            testCompile 'junit:junit:4.12'
            compile 'com.google.firebase:firebase-database:15.0.0'
            compile 'com.google.firebase:firebase-auth:15.0.0'
            compile 'com.google.firebase:firebase-core:15.0.0'
            compile 'com.firebaseui:firebase-ui-database:3.3.0'
            compile 'com.android.support:design:24.2.0'
            compile 'com.android.support:appcompat-v7:24.2.0'
            compile 'com.github.bumptech.glide:glide:3.6.1'
        }apply plugin: 'com.google.gms.google-services'

错误:

【问题讨论】:

  • 有什么问题?
  • 当我添加特定于 firebaseUI 的那一行时,它会在 values.xml 文件中显示某种错误
  • 某种错误?什么错误?
  • 在帖子中添加错误
  • 你能发布整个 gradle 文件吗?

标签: android firebase-authentication firebase-cloud-messaging firebase-security firebaseui


【解决方案1】:

FirebaseUI 的 github 存储库中的 README 非常清楚。您需要显式覆盖每个 UI 库的所有传递依赖项,例如,如果您正在使用 firebase-ui-auth 版本 3.3.0 但想要使用 firebase 版本 15.0.0support libaries 版本 27.1.1,这将是一些东西如下所示。

implementation 'com.firebaseui:firebase-ui-auth:3.3.0'

implementation 'com.google.firebase:firebase-auth:15.0.0'
implementation 'com.google.android.gms:play-services-auth:15.0.0'

implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:customtabs:27.1.1'
implementation "com.android.support:cardview-v7:27.1.1"
implementation 'com.android.support:design:27.1.1'

【讨论】:

    【解决方案2】:

    尝试更新您的设置,Firebase UI 仍然依赖于版本 12.0.1 而不是 15.0.0。请参阅 docs 以查看哪些版本与哪些 firebase ui 版本匹配:

    apply plugin: 'com.android.application'
       repositories {
            mavenLocal()
            flatDir {
                dirs 'libs'
            }
            maven { url "https://maven.google.com" }
    
        }
            android {
            compileSdkVersion 27
            buildToolsVersion '27.0.3'
          defaultConfig {
                applicationId "com.google.firebase.udacity.friendlychat"
                minSdkVersion 16
                targetSdkVersion 27
                versionCode 1
                versionName "1.0"
                resConfigs "en"
            }
            buildTypes {
                release {
                    minifyEnabled false
                    proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
                }
            }
            packagingOptions {
                exclude 'META-INF/LICENSE'
                exclude 'META-INF/LICENSE-FIREBASE.txt'
                exclude 'META-INF/NOTICE'
            }
        }
        dependencies {
            compile fileTree(dir: 'libs', include: ['*.jar'])
            testCompile 'junit:junit:4.12'
            compile 'com.google.firebase:firebase-database:12.0.1'
            compile 'com.google.firebase:firebase-auth:12.0.1'
            compile 'com.google.firebase:firebase-core:12.0.1'
            compile 'com.firebaseui:firebase-ui-database:3.3.0'
            compile 'com.android.support:design:27.1.1'
            compile 'com.android.support:appcompat-v7:27.1.1'
            compile 'com.github.bumptech.glide:glide:3.6.1'
        }
    
    apply plugin: 'com.google.gms.google-services'
    

    【讨论】:

    • 我尝试过版本 15,但结果相同
    • 版本 12,而不是 15。firebase UI 的 3.3.0 版本依赖于 firebase 的 12,github.com/firebase/FirebaseUI-Android
    • 我从15改成了12.0.1,还是一样的错误
    • 最后一项措施是更新您的其他依赖项、compilesdk、buildtoolsversion 并支持 lib 版本。签出编辑:) 如果这不起作用,请发布您的项目级构建 gradle 文件
    • @LoveBabbar 这个 gradle 使用的是 27 appcompat 和 design,你使用的是 24
    【解决方案3】:

    无论您想使用哪种 Firebase UI 依赖项,都可以尝试添加以下两个依赖项。 它对我有用,这也可能对你有用

    implementation "android.arch.core:runtime:1.1.1"
    implementation "android.arch.core:common:1.1.1"
    

    【讨论】:

      猜你喜欢
      • 2023-04-03
      • 1970-01-01
      • 1970-01-01
      • 2020-10-17
      • 1970-01-01
      • 2019-12-25
      • 2013-06-09
      • 2013-07-08
      • 2016-10-20
      相关资源
      最近更新 更多