OneSignal / OneSignal-Flutter-SDK

OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your flutter app with OneSignal
https://www.onesignal.com
Other
606 stars 204 forks source link

[Bug]: uses-sdk:minSdkVersion 19 cannot be smaller than version 21 declared in library [com.onesignal:OneSignal:5.1.13] #898

Closed AchmadSyarippudin closed 3 weeks ago

AchmadSyarippudin commented 3 weeks ago

What happened?

Can't build my flutter application on android emulator after add onesignal_flutter: ^5.2.0 on pubspec.yaml

Steps to reproduce?

1. Flutter 3.16.5
2. android compileSdkVersion 34
2. Android Emulator version Android 14.0 arm64

What did you expect to happen?

before adding onesignal dependencies i was able to run the app, so i hope to be able to run it after adding onesignal dependencies

OneSignal Flutter SDK version

onesignal_flutter: ^5.2.0

Which platform(s) are affected?

Relevant log output

/Users/achmadsyarippudinnur/Development/Apps/Flutter/wedeals/android/app/src/debug/AndroidManifest.xml Error:
    uses-sdk:minSdkVersion 19 cannot be smaller than version 21 declared in library [com.onesignal:OneSignal:5.1.13] /Users/achmadsyarippudinnur/.gradle/caches/transforms-3/1f7e6763bb13fe5a711b93aedc56dfec/transformed/jetified-OneSignal-5.1.13/AndroidManifest.xml as the library might be using APIs not available in 19
    Suggestion: use a compatible library with a minSdk of at most 19,
        or increase this project's minSdk version to at least 21,
        or use tools:overrideLibrary="com.onesignal" to force usage (may lead to runtime failures)

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugMainManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 19 cannot be smaller than version 21 declared in library [com.onesignal:OneSignal:5.1.13] /Users/achmadsyarippudinnur/.gradle/caches/transforms-3/1f7e6763bb13fe5a711b93aedc56dfec/transformed/jetified-OneSignal-5.1.13/AndroidManifest.xml as the library might be using APIs not available in 19
    Suggestion: use a compatible library with a minSdk of at most 19,
        or increase this project's minSdk version to at least 21,
        or use tools:overrideLibrary="com.onesignal" to force usage (may lead to runtime failures)

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

Code of Conduct

jkasten2 commented 3 weeks ago

@AchmadSyarippudin you will have to increase your minSdkVersion to 21 to get your project building again. It depends on how your project is configured but this is one set of instructions you can follow to update minSdkVersion: https://stackoverflow.com/a/70316521

AchmadSyarippudin commented 3 weeks ago

@jkasten2 thank you this solved my problem

AchmadSyarippudin commented 3 weeks ago

solved by update minSdkVersion to 21

https://stackoverflow.com/a/70316521