我遇到了这个问题,我试图寻找解决方案,有人可以帮助我吗?
消息错误是:
清单合并失败:uses-sdk:minSdkVersion 14不能更小 比在库[com.firebaseui:firebase-ui:0.4.4]中声明的版本16 C:\ Users \ hp.gradle \ caches \ transforms-1 \ files-1.1 \ firebase-ui-0.4.4.aar \ 98e3098a92ea993df7efea933cd6b11e \ AndroidManifest.xml 因为该库可能使用14建议中不提供的API: 使用兼容的库,其minSdk最多为14,或者增加 此项目的minSdk版本至少为16,或使用 tools:overrideLibrary =“ com.firebase.ui”强制使用(可能导致 运行时失败)
这是我的 build.gradle(应用程序)文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.hp.koudyani"
minSdkVersion 14
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' }
} }
repositories {
mavenCentral() }
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
// noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso- core:3.0.2'
// FirebaseUI for Firebase Auth
// implementation 'com.firebaseui:firebase-ui-auth:16.0.5'
// FirebaseUI for Cloud Storage
//mplementation 'com.firebaseui:firebase-ui-storage:16.0.3'
// Required only if Facebook login support is required
implementation 'com.facebook.android:facebook-login:4.38.1'
implementation 'com.firebaseui:firebase-ui:4.2.1'
//implementation 'com.google.firebase:firebase-core:16.0.5'
// implementation 'com.google.firebase:firebase-auth:16.0.5'
//implementation 'com.google.firebase:firebase-database:16.0.5'
//implementation 'com.google.firebase:firebase-storage:16.0.5'
implementation 'com.facebook.android:facebook-android-sdk:4.38.1'
}
apply plugin: 'com.google.gms.google-services'
AndroidManifest.xml文件:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.hp.koudyani">
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"
tools:ignore="GoogleAppIndexingWarning">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data
android:name="preloaded_fonts"
android:resource="@array/preloaded_fonts" />
//Facebook login
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/>
<activity android:name="com.facebook.FacebookActivity" android:configChanges= "keyboard|keyboardHidden|screenLayout|screenSize|orientation" android:label="@string/app_name" />
<activity android:name="com.facebook.CustomTabActivity" android:exported="true"> <intent-filter> <action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.BROWSABLE" /> <data android:scheme="@string/fb_login_protocol_scheme" />
</intent-filter> </activity>
//end facebook login
</application>
</manifest>
答案 0 :(得分:1)
根据错误消息的提示,将build.gradle
中的 minSdkVersion 增加到 16 。