FlutterToast
FlutterToast copied to clipboard
compileSdkVersion 34
#466 broke apps with compileSdkVersion
less than 34. That was released as a patch (8.2.2 => 8.2.3), which is not backwards-compatible. Please revert this change.
Note that #467 only reverted the minSdkVersion
change which is necessary but not sufficient to prevent breaking backwards-compatibility.
I got build error today. I just updated flutter/dart SDK to latest version, and hit flutter pub get
. I tried cleaning pub cache, build and also downgrading flutter/dart SDK to old one. but not luck.
I noticed that fluttertoast's minSdkVersion
changes since 8.2.3.
I also checked what was changed on Flutter SDK, minSdkVersion
stays 19.
According to build error log, seems there are two options to make it TEMPORALY.
- Change
minSdkVersion
property fromflutter.minSdkVersion
to 22 inbuild.gradle[app]
- Fix a version of fluttertoast 8.2.2.
Both are not good solution.
Anyone who suffers get build error like below, please stay 8.2.2 and I wish this issue resolved ASAP.
$ flutter build apk --debug
D:\app_flutter\android\app\src\debug\AndroidManifest.xml Error:
uses-sdk:minSdkVersion 19 cannot be smaller than version 21 declared in library [:fluttertoast] D:\app_flutter\build\fluttertoast\intermediates\merged_manifest\debug\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="io.github.ponnamkarthik.toast.fluttertoast" 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 [:fluttertoast] D:\app_flutter\build\fluttertoast\intermediates\merged_manifest\deb
ug\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="io.github.ponnamkarthik.toast.fluttertoast" 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.
* Get more help at https://help.gradle.org
BUILD FAILED in 1m 8s
Running Gradle task 'assembleDebug'... 69.5s
┌─ Flutter Fix ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ The plugin fluttertoast requires a higher Android SDK version. │
│ Fix this issue by adding the following to the file D:\app_flutter\android\app\build.gradle: │
│ android { │
│ defaultConfig { │
│ minSdkVersion 21 │
│ } │
│ } │
│ │
│ │
│ Following this change, your app will not be available to users running Android SDKs below 21. │
│ Consider searching for a version of this plugin that supports these lower versions of the Android SDK instead. │
│ For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration │
└───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
Gradle task assembleDebug failed with exit code 1
flutter doctor -v
[√] Flutter (Channel stable, 3.16.0, on Microsoft Windows [Version 10.0.19045.3693], locale ko-KR)
• Flutter version 3.16.0 on channel stable at D:\flutter-3.13.3-stable
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision db7ef5bf9f (7 days ago), 2023-11-15 11:25:44 -0800
• Engine revision 74d16627b9
• Dart version 3.2.0
• DevTools version 2.28.2
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at D:\Android_SDK
• Platform android-34, build-tools 34.0.0
• ANDROID_HOME = D:\Android_SDK
• Java binary at: D:\00_IDE\android-studio-223\jbr\bin\java
• Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-10027231)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe
[X] Visual Studio - develop Windows apps
X Visual Studio not installed; this is necessary to develop Windows apps.
Download at https://visualstudio.microsoft.com/downloads/.
Please install the "Desktop development with C++" workload, including all of its default components
[√] Android Studio (version 2022.3)
• Android Studio at D:\00_IDE\android-studio-223
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• android-studio-dir = D:\00_IDE\android-studio-223
• Java version OpenJDK Runtime Environment (build 17.0.6+0-b2043.56-10027231)
[√] VS Code (version 1.65.2)
• VS Code at C:\Users\oysu\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.36.0
[√] Connected device (3 available)
• SM F936N (mobile) • R3CT903JW6B • android-arm64 • Android 13 (API 33)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19045.3693]
• Chrome (web) • chrome • web-javascript • unknown
[√] Network resources
• All expected network resources are available.
! Doctor found issues in 1 category.