About Sdk and firebase - android

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.

Related

minSdkVersion 19 cannot be smaller than version 21 declared in library [com.facebook.react:react-native:0.71.0-rc.0]

Following is my React-Native app's configuration,
android/app/buid.gradle:
defaultConfig {
minSdkVersion 19
targetSdkVersion 30
compileSdkVersion 30
buildToolsVersion '30.0.3'
multiDexEnabled true
missingDimensionStrategy 'react-native-camera', 'mlkit'
missingDimensionStrategy 'react-native-camera', 'general'
}
gradle-wrapper.properties:
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip
Facing following error when I run from Android Studio
minSdkVersion 19 cannot be smaller than version 21 declared in library [com.facebook.react:react-native:0.71.0-rc.0]
I must support minSdkVersion 19 as many of my users are still using lower versions of android.
Hence, How can i continue with minSdkVersion 19 with out any error?
Note: I have gone through the suggested question and have already applied suggested changes. But still facing the error.

Having error in android studio using kotlin

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

Android Studio ERROR: Manifest merger failed : uses-sdk:minSdkVersion

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

Which compileSdkVersion should I use in my android project?

I'm using latest dependencies in my project. My minSdkVersion is set as 15 and targetSdkVersion is 26. Which build tools and compileSdkVersion should I use so that the app can be run even in Adnroid 5.
Here are the details-
compileSdkVersion 28
buildToolsVersion '28.0.3'
defaultConfig {
applicationId "com.app.shoppingbull"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
}
Will these work fine in all devices or I have to reduce the CompileSdkVersion?
Always follow this,
minSdkVersion <= targetSdkVersion <= compileSdkVersion
Because, when you develop app always target the latest SDK so that you provide the latest features of Google to your user.
According to source.android.com if you want to make your App can be run in Adnroid 5 and newer, you should set the minSdkVersion to 21
tip: don't make your minSdkVersion lower than 21
Your application will work in the range of minSdkVersion and targetSdkVersion api level.
You should target your app to the latest version of Android SDK version (see SDK Platform release notes) to make sure you've covered all the Android version. It also force you to check if your code is working correctly with the latest version.
So, change your app build.gradle to something like this:
compileSdkVersion 28
buildToolsVersion '28.0.3'
defaultConfig {
applicationId "com.app.shoppingbull"
minSdkVersion 15
targetSdkVersion 28 // latest stdk
versionCode 1
versionName "1.0"
Ideally, your targetSdkVersion and compileSdkVersion should be the same, and the latest. That's 28 at the current time of writing.
minSdkVersion dictates the minimum version your app will support, so having a compile/target of 28 will still let you run on 15.

Minimum Sdk support doesn't work for my app. How to resolve this?

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"
}
}

Categories

Resources