Shazail Malik
Shazail Malik

Reputation: 19

Dependency Issue in android

I have facing an error when I add my dependency which does not sync while adding authentication to my app using firebase

Manifest merger failed :
uses-sdk:minSdkVersion 15 cannot be smaller than version 16 declared in library 
[com.google.firebase:firebase-auth:19.2.0] C:\Users\Shazail Malik\.gradle\caches\transforms-2\files-2.1\7c78a11c6b4a4456334831db0797030d\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)

Upvotes: 1

Views: 156

Answers (4)

Chandela
Chandela

Reputation: 312

If you want to include uses-sdk:minSdkVersion=14 than you must have to downgrade your dependency to com.google.firebase:firebase-auth:16.0.5 as this allows working with min-sdk-14

But this is not a recommended solution. You should always have to use the latest dependencies in your project as in the latest version google aways add some new features or methods to use in the application.

For latest release please check https://firebase.google.com/support/release-notes/android

And

For firebase Auth please check https://firebase.google.com/docs/android/setup

Upvotes: 0

Md. Enamul Haque
Md. Enamul Haque

Reputation: 1026

Open build.gradle(Module: app) Under Gradle Scripts

Your minSdkVersion is 15

defaultConfig {
    minSdkVersion 15
}

Change it to 16 like this

defaultConfig {
    minSdkVersion 16
}

Upvotes: 0

Md. Asaduzzaman
Md. Asaduzzaman

Reputation: 15423

To use latest Firebase libraries, the minimum API level should be 16.

Make sure that your app meets the following requirements:

  • Targets API level 16 (Jelly Bean) or later
  • Uses Gradle 4.1 or later

Check documentation for more details.

Upvotes: 1

Prajwal Waingankar
Prajwal Waingankar

Reputation: 2710

You have your answer in the error log itself.

Solution:

  1. Set uses-sdk:minSdkVersion to 16 or higher in your manifest file.

  2. tools:overrideLibrary="com.google.firebase.auth"

For the 2nd solution, try avoiding it as it might led to crashes for you at runtime.

Upvotes: 0

Related Questions