0

When I try to build the apk, I get this error :

Manifest merger failed : uses-sdk:minSdkVersion 15 cannot be smaller than version 16 declared in library [com.google.firebase:firebase-messaging:19.0.1] C:\Users\taha\.gradle\caches\transforms-2\files-2.1\eff6e7bdbf3eaa269c101b27c652fb15\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.messaging" to force usage (may lead to runtime failures)

Here is the gradle build. I tried to update SDK version from 27 to 28 and it didn't work:

android {
compileSdkVersion 27
defaultConfig {
    applicationId ''

    minSdkVersion 15
    targetSdkVersion 27
    versionCode 1
    versionName "1.0.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
productFlavors {
}

}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    testImplementation 'junit:junit:4.13-beta-3'
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.android.support:cardview-v7:27.1.1'
    implementation 'com.android.support:palette-v7:27.1.1'
    implementation 'com.android.support:recyclerview-v7:27.1.1'
    implementation 'com.balysv:material-ripple:1.0.2'
    implementation 'com.google.android.gms:play-services-ads:18.0.0'
    implementation 'com.google.firebase:firebase-core:17.0.0'
    implementation 'com.google.firebase:firebase-messaging:19.0.1'
    implementation 'com.squareup.picasso:picasso:2.71828'
    implementation 'com.onesignal:OneSignal:3.10.9'
    implementation 'com.google.android.ads.consent:consent-library:1.0.7'
}

apply plugin: 'com.google.gms.google-services'
Olivia Stork
  • 4,660
  • 5
  • 27
  • 40
mkmtools
  • 43
  • 1
  • 5
  • Please explain your question rather than giving just errors.. – Abhinav Kinagi Jul 12 '19 at 14:16
  • Hi mkmtools, welcome to Stackoverflow. The information your provided is not sufficient. Try updating your question with a clear problem statement, share relevant code and the error you are facing and the things you have tried on your own to fix the problem. Good luck. – Syed Ahmed Jamil Jul 12 '19 at 14:30

1 Answers1

2

As per the Google Play services blog post, Google Play services and Firebase, including the com.google.firebase:firebase-messaging library have moved to a minSdkVersion of 16. You'll need to change your minSdkVersion to 16 or move back to an older version of all of the libraries.

ianhanniballake
  • 191,609
  • 30
  • 470
  • 443