【问题标题】:compile 'com.firebaseui:firebase-ui-auth:0.4.0' gradle build error编译 'com.firebaseui:firebase-ui-auth:0.4.0' gradle 构建错误
【发布时间】:2019-03-02 13:30:52
【问题描述】:

我正在这个应用程序中创建一个基于聊天的应用程序,它需要我使用的 AuthUI

compile 'com.firebaseui:firebase-ui-auth:0.4.0'

当我点击同步时,它会显示这个错误

错误:任务 ':app:processDebugManifest' 执行失败。 清单合并失败:uses-sdk:minSdkVersion 15 不能小于库 [com.firebaseui:firebase-ui-auth:0.4.0] C:\Users\Pankaj.android\build-cache\b6b125d590bd1b7420872b94c0da26aebbc55221\output 中声明的版本 16 \AndroidManifest.xml 建议:使用 tools:overrideLibrary="com.firebase.ui.auth" 强制使用

build.gradle(app)

compile 'com.android.support:appcompat-v7:26.+'
compile 'com.github.d-max:spots-dialog:0.7@aar'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.android.support:design:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.volley:volley:1.1.0'
compile 'com.github.bumptech.glide:glide:4.0.0'
compile 'com.android.support:recyclerview-v7:26.+'
compile 'net.gotev:uploadservice:2.1'
compile 'com.firebaseui:firebase-ui-database:0.4.0'

compile 'com.firebaseui:firebase-ui-auth:0.4.0'
compile 'com.android.support:support-v4:26.+'
testCompile 'junit:junit:4.12'

build.gradle(项目)

// 顶级构建文件,您可以在其中添加所有子项目/模块通用的配置选项。

buildscript {
repositories {

    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:2.3.0'

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
    classpath 'com.google.gms:google-services:3.1.0'
}
}

allprojects {
repositories {
    jcenter()
    maven {
        url 'https://maven.fabric.io/public'
    }
}
}

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

【问题讨论】:

  • 执行错误消息中所说的任何操作
  • ...
  • @Toaster我不明白你想说什么我是这方面的初学者请理解我,谢谢
  • tools:overrideLibrary="com.firebase.ui.auth"

标签: android firebase firebase-authentication


【解决方案1】:

在模块的build.gradle 中将最低 API 级别从 15 提高到 16

android {
    defaultConfig {
        minSdkVersion 16
    }
}

tools:overrideLibrary 不是一个真正的选项,因为它会在 API 级别 15 的设备上崩溃。

【讨论】:

    【解决方案2】:

    这是因为 FirebaseUI 需要 API 16 或更高版本才能运行,而您的应用的 minSdkVersion 设置为 15。如果 Android Studio 允许您这样构建,您的应用只会在 API 15 上崩溃。

    cmets 建议使用tools:overrideLibraryManifest 字段,但由于上述原因,我不建议这样做。您必须为 API 15 用户实现自己的授权 UI。

    According to Google,0.3% 的活跃 Android 用户目前正在使用 API 15。这只是安装了 Play 商店的设备,但它很好地代表了运行 API 15 的 Android 用户的总比例。如果你是实现 FirebaseUI,为 Android 用户总数的 0.3% 制作自己的 Auth UI 根本不值得。

    最简单和最明智的解决方案可能是将您的 minSdkVersion 更改为 16。您已经错过了 API 10-14 上其他 0.3% 的用户。另外 0.3% 什么都不是。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-07-03
      • 2017-11-02
      • 2018-03-30
      • 2018-10-19
      • 2012-10-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多