Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running example on android device leads to an error #276

Open
quoc-huynh-cosee opened this issue Dec 6, 2023 · 0 comments
Open

Running example on android device leads to an error #276

quoc-huynh-cosee opened this issue Dec 6, 2023 · 0 comments

Comments

@quoc-huynh-cosee
Copy link

Running the example on android leads to the following error. This is due that the package fluttertoast uses minSdk 21.

/Users/huynh/StudioProjects/image_gallery_saver/example/android/app/src/main/AndroidManifest.xml Error:
	uses-sdk:minSdkVersion 19 cannot be smaller than version 21 declared in library [:fluttertoast] /Users/huynh/StudioProjects/image_gallery_saver/example/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] /Users/huynh/StudioProjects/image_gallery_saver/example/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)

* 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 2s

┌─ Flutter Fix ─────────────────────────────────────────────────────────────────────────────────┐
│ The plugin fluttertoast requires a higher Android SDK version.                                │
│ Fix this issue by adding the following to the file                                            │
│ /Users/huynh/StudioProjects/image_gallery_saver/example/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          │
└───────────────────────────────────────────────────────────────────────────────────────────────┘
Exception: Gradle task assembleDebug failed with exit code 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant