user8542613
user8542613

Reputation: 755

Android, Firebase: Manifest merger failed : uses-sdk:minSdkVersion 15 cannot be smaller than version 16

My app/build.gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion "26.0.1"
    defaultConfig {
        applicationId "com.example.firebase"
        minSdkVersion 15
        targetSdkVersion 26
        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(dir: 'libs', include: ['*.jar'])
    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:26.+'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'

    compile 'com.google.firebase:firebase-auth:11.0.4'
    compile 'com.firebaseui:firebase-ui-auth:2.3.0'
    compile "com.android.support:design:26.1.0"
    compile "com.android.support:customtabs:26.1.0"
    compile "com.android.support:cardview-v7:26.1.0"

    testCompile 'junit:junit:4.12'
}


apply plugin: 'com.google.gms.google-services'

But when I try to build my Android project I get error:

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-auth:2.3.0] 

I can't change minSdkVersion because this is the client's requirement - run Android application on min. ver = 15

Upvotes: 2

Views: 2814

Answers (2)

Gabriele Mariotti
Gabriele Mariotti

Reputation: 363577

I can't change minSdkVersion because this is the client's requirement - run Adnroid application on min. ver = 15

You can't do it since you are using some dependencies with minSdk = 16 (in your case the firebase-ui has a minSdk=16).

You can choose an older version of the dependencies but you will have always problems in the future since you will not able to update them.

As you can check in the official dashboard, today with minSdk=16 you will cover over the 99% of the devices.

In any case, if it is a strong requirement of the customer you can create multiple APKs for Different API Levels.

It means that you can create different flavors in your build.gradle with a different level of api and different dependencies. In this way you will be able to support device with api 15 and also the new versions of the libraries used.

productFlavors {

    // priority than the second, and so on.
    minApi15 {
      minSdkVersion '15'
      ...
    }

    minApi16 {
      minSdkVersion '16'
   }
}

dependencies {
  minApi15Compile xxxxx
  minApi16Compile xxxxx
}

Upvotes: 3

Alex Mamo
Alex Mamo

Reputation: 138824

To solve this problem, you need to downgrade the version of your com.firebaseui:firebase-ui-auth:2.3.0.

2.3.0 is the latest version. According to FirebaseUI-Android you need to use an earlier version which allow you to use minSdkVersion 15.

Hope it helps.

Upvotes: 2

Related Questions