Manifest merger failed : uses-sdk:minSdkVersion 15 cannot be smaller than version 16 declared in library [com.google.firebase:firebase-auth:19.2.0] /home/shubham/.gradle/caches/transforms-2/files-2.1/782dd1b43e0016afc3d7d0a4252da9e3/firebase-auth-19.2.0/AndroidManifest.xml as the library might be using APIs not available in 15
Suggestion: use a compatible library with a minSdk of at most 15,
or increase this project's minSdk version to at least 16,
or use tools:overrideLibrary="com.google.firebase.auth" to force usage (may lead to runtime failures)
In your application modules' build.gradle; change minSdkVersion to at least 16.
Like so:
android {
defaultConfig {
applicationId "YOUR_APPLICATION_ID"
minSdkVersion 16
targetSdkVersion 29
versionCode 1
versionName "1.0.0"
}
com.google.firebase.auth min 16 ,your project min is 15,you should change minSdkVersion to 16.the bad way to solve it is to your mainfest,it can be run but may be error when run
Related
ERROR: Manifest merger failed : uses-sdk:minSdkVersion 15 cannot be smaller than version 16 declared in library [com.google.firebase:firebase-iid:19.0.0] C:\Users\User.gradle\caches\transforms-2\files-2.1\856a947c1a9c6ebc4d2fc0c2fb4dbece\firebase-iid-19.0.0\AndroidManifest.xml as the library might be using APIs not available in 15
Suggestion: use a compatible library with a minSdk of at most 15,
or increase this project's minSdk version to at least 16,
or use tools:overrideLibrary="com.google.firebase.iid" to force usage (may lead to runtime failures)
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath 'com.google.gms:google-services:4.2.0' // Google Services plugin
}
dependencies {
// Add the Firebase SDK for Google Analytics
implementation 'com.google.firebase:firebase-analytics:17.1.0'
}
minSdkVersion for firebase library is changed to API level 16 to align with the Google Play services distribution policy.
so you have to change your gradle file like
android {
...
defaultConfig {
minSdkVersion 16
..
}
}
Error says minSdkVersion 15 cannot be smaller than version 16
In that case:
Just change the minSdkVersion in gradle file to 16
The minimum SDK level required to use the most recently versions of Firebase libraries is 16. There is no workaround.
In your build.gradle file change the value with:
android {
...
defaultConfig {
minSdkVersion 16 //or higher
..
}
}
in your build.gradle file, please change the version higher than "minSdkVersion 15".
android {
compileSdkVersion 28
defaultConfig {
applicationId 'com.Demo'
minSdkVersion 21
targetSdkVersion 28
versionCode 10
versionName "1.6"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
and Add gradle :- implementation 'com.android.support:multidex:1.0.3'
Please go to build.gradle(Module.app) and update "minSdkVersion" to 16 or more as below:
defaultConfig {
.............
minSdkVersion 21
............
}
or upper then click on "Sync".
I encountered the same problem and the solution worked for me as follows:
You have to go to the build.gradle file .. app
and then to the defaultConfig{ . section
and replace this text
minSdkVersion flutter.targetSdkVersion
with this code
minSdkVersion 19
then click on "Sync".
Of course, this solution will work with those who work on Platform Flutter , Visual studio code
when i add these lines of firebase in andriod studio i got these errors
android {
compileSdkVersion 28
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.example.rashid"
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
classpath 'com.google.gms:google-services:4.2.0'
implementation 'com.google.firebase:firebase-core:17.0.0'
apply plugin: 'com.google.gms.google-services'
ERROR: Manifest merger failed : uses-sdk:minSdkVersion 15 cannot be smaller than version 16 declared in library [com.google.firebase:firebase-iid:19.0.0] C:\Users\hp.gradle\caches\transforms-2\files-2.1\db323219c95310ba498dc7530caba4e9\AndroidManifest.xml as the library might be using APIs not available in 15
Suggestion: use a compatible library with a minSdk of at most 15,
or increase this project's minSdk version to at least 16,
or use tools:overrideLibrary="com.google.firebase.iid" to force usage (may lead to runtime failures)
This is a small fix. In you build gradle (app), there should be a line of code that says:
minSDK 15
Change that 15 to a 16 or 17 and then it should work.
Execution failed for task :app:processDebugManifest
Manifest merger failed:
uses-sdk:minSdkVersion 1 cannot be smaller than version 7 declared in library [com.android.support:appcompat-v7:23.2.0] C:\Users\bsuni\AndroidStudioProjects\Rec\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\23.2.0\AndroidManifest.xml Suggestion: use tools:overrideLibrary="android.support.v7.appcompat" to force usage
You have to update the minimum SDK 7 to 16. And also update the Max version to the latest. Always try to use the latest version and latest build version. Please try this build configuration:
defaultConfig {
applicationId "com.XXX.XXXX" // your application package
multiDexEnabled true
minSdkVersion 16 // here 16 so change accordingly
targetSdkVersion 28
versionCode 1
versionName "1.0.0"
}
And also update the all support version from 23.2.0 to 28.0.0.
looks like you need to increase the minDK version to 7 in your app gradle file
<uses-sdk tools:overrideLibrary="android.support.v7.appcompat"/>
don't forget to include xmlns:tools="http://schemas.android.com/tools" too, before the tag
Some issue with minSdkVersion so correct it, change it more than 7
defaultConfig {
applicationId "com.XXX.XXXX" // your application package
multiDexEnabled true
minSdkVersion 14 // here 14 so change accordingly
targetSdkVersion 18
versionCode 99
versionName "11.1.5.5"
}
Another way
First try above and not works than make following changes
<uses-sdk tools:overrideLibrary="android.support.v7.appcompat"/>
to your AndroidManifest.xml and it will work. This will enable the Manifest merger to add this also when the API version is older. Don't forget to add the tools namespace at your xml root as shown below.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.app"
xmlns:tools="http://schemas.android.com/tools">
When developing for Instant Apps the use of Configuration APKs (https://developer.android.com/topic/instant-apps/guides/config-splits.html) offers useful option for cutting down on APK size. However it looks like they are only supported when using mindSdk of 21 or later. For example, you get following error if you try to use this capability for lower sdk versions.
MinSdkVersion 17 is too low (<21) to support pure splits, reverting to full APKs
Is there way to have base module for example use pure split functionality while still having installed app target pre lollipop devices?
Since the minSdkVersion flag will toggle quite a few checks, this change is not done automatically for you.
I'd recommend introducing a product flavor for both the installed and instant module with different minSdkVersions, like this:
// :feature/base/build.gradle
flavorDimensions 'delivery'
productFlavors {
instant {
dimension 'delivery'
minSdkVersion rootProject.minSdkInstant
}
installed {
dimension 'delivery'
}
}
This will have to be done similarly in other modules that depend on the feature module with API level < 21.
Instant apps are only supported in API 21+ devices (link), older devices will only support full apk.
The better approach is to define different minSdk based on your module, like:
You can take a look at Google's analytics sample on GitHub
Project's gradle
ext {
buildTools = '26.0.2'
compileSdk = 26
minSdk = 15
minSdkInstant = 21
versionCode = 1
versionName = '1.0'
supportLib = '26.1.0'
firebaseVer = '10.2.4'
instantAppsVer = '1.0.0'
}
Base gradle
android {
compileSdkVersion rootProject.compileSdk
buildToolsVersion rootProject.buildTools
baseFeature true
defaultConfig {
minSdkVersion rootProject.minSdk
targetSdkVersion rootProject.compileSdk
versionCode rootProject.versionCode
versionName rootProject.versionName
}
buildTypes {
release {}
}
}
Installed gradle
defaultConfig {
applicationId "com.example.android.instant.analytics"
minSdkVersion rootProject.minSdk
targetSdkVersion rootProject.compileSdk
versionCode rootProject.versionCode
versionName rootProject.versionName
}
Instant gradle
android {
defaultConfig {
minSdkVersion rootProject.minSdkInstant
}
}
You can specify a different lower minSdkVersion for your application module if you use tools:overrideLibrary Please see How do I use tools:overrideLibrary in a build.gradle file?
This is how I did it:
app/build.gradle
android {
defaultConfig {
minSdkVersion 17
}
}
app’s manifest
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.package.app" xmlns:tools="http://schemas.android.com/tools" >
<uses-sdk tools:overrideLibrary="com.package,com.package.feature"/>
</manifest>
You will need to add all the package names where you wish to override their minSdkVersion. You will know which ones to add by looking at the error:
Manifest merger failed ...
AndroidManifest.xml as the library might be using APIs not available
in 17 Suggestion: use a compatible library with a minSdk of at most
17,
or increase this project's minSdk version to at least 21,
or use tools:overrideLibrary="com.package.feature" to force usage (may lead to runtime failures)
base and feature/build.gradle
android {
defaultConfig {
minSdkVersion 21
}
}
Test it by building the installed/instant APKs, then analyzing then for the minSdkVersion value. The installed should be at 17, and your base/feature APKs will still be on 21.
I've just developed an app. I set API23 while creating project. Now I changed Min Sdk version to API 16 via File>Project Structure > app>flavors. But app won't run other than API 23 (Marshmallows).... What do I do now??
Did you change the minSdk to 16 in the build.gradle?
Try to add minSdkVersion to 16 in your app>build.gradle file:
android {
defaultConfig {
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
}