firebase版本的错误消息[0.6.2]

时间:2018-04-13 22:29:45

标签: java firebase android-studio

我正在尝试使用firbase建立聊天室。

但是当我输入以下代码时发生了错误

compile 'com.firebaseui:firebase-ui:0.6.2'

这是build.gradle应用程序模块

apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "26.0.1"
defaultConfig {
    applicationId "com.example.kenny.bettingai"
    minSdkVersion 15
    targetSdkVersion 25
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
compile files('libs/J-Excel-1.0-SNAPSHOT.jar')
compile files('libs/jxl.jar')

compile 'com.firebaseui:firebase-ui:0.6.2'
}

这是错误消息

Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 15 cannot be smaller than 
version 16 declared in library [com.firebaseui:firebase-ui:0.6.2] 
C:\Users\Kenny\.android\build- 
cache\32db91379d86947a54b2b6b2ac61dd84080343b4\output\AndroidManifest.xml
Suggestion: use tools:overrideLibrary="com.firebase.ui" to force usage

有谁能告诉我强制覆盖库的方法是什么?

1 个答案:

答案 0 :(得分:0)

从这个错误可以看出:

Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 15 cannot be smaller than 
version 16 declared in library [com.firebaseui:firebase-ui:0.6.2] 

这意味着com.firebaseui:firebase-ui:0.6.2正在使用minSdkVersion 16,但您使用的是minSdkVersion 15.因此,您需要将minSdkVersion更改为 16 或将tools:overrideLibrary="com.firebase.ui"添加到您的 AndroidManifest.xml 类似这样的内容:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.myapp"
    xmlns:tools="http://schemas.android.com/tools">

    <uses-sdk tools:overrideLibrary="com.firebase.ui"/>

</manifest>

注意:您不应强制库使用minSdkVersion 15,因为库可能无法使用它。