FlutterFlow / flutterflow-issues

A community issue tracker for FlutterFlow.
113 stars 19 forks source link

Unable to adjust minSdkVersion so I cannot use libraries that are dependent on a specific Android version #1803

Closed payminty-shaun closed 8 months ago

payminty-shaun commented 9 months ago

Has your issue been reported?

Current Behavior

I receive this error message during my Android builds:

/Users/builder/clone/android/app/src/main/AndroidManifest.xml Error: uses-sdk:minSdkVersion 21 cannot be smaller than version 26 declared in library [:mek_stripe_terminal] /Users/builder/clone/build/mek_stripe_terminal/intermediates/merged_manifest/release/AndroidManifest.xml as the library might be using APIs not available in 21 Suggestion: use a compatible library with a minSdk of at most 21, or increase this project's minSdk version to at least 26, or use tools:overrideLibrary="mek.stripeterminal" to force usage (may lead to runtime failures)

FAILURE: Build failed with an exception.

Expected Behavior

If I build this locally with minSdkVersion, then the build works perfectly. I would however like to use the built in FlutterFlow deployment process as I am paying for a Teams license.

Steps to Reproduce

  1. Install a dependency that requires a minSdkVersion, in my case this is this dependency: https://pub.dev/packages/mek_stripe_terminal

  2. Try to perform a deployment to the Google Play store

  3. Build process fails with the above error.

Reproducible from Blank

Bug Report Code (Required)

IT40iPLq5YtNobgA0a6JbsFKmio5JWIjULs3i+1BaCsofePrOpkAf8/7UFtUONPjT39XemKaq3wX/Mrovt/fNPdeCxerQIh7zJAJYTrdWj6jbqqXPK63b3dDI5hjJ0yH0cHQohRQWdZtdHwi12D3Fd6ycDHYJp/6PDA/ReaoXdeK2SrDX1iXc2URm05KZDPz

Context

I need this dependency for my application and this issue is preventing me from using the build/deploy process in FlutterFlow for Android. As a result, I am having to sync my project with GitHub and perform my builds locally which is more inefficient.

Visual documentation

Codemagic Deploy Output Failed Step: Build AAB with Flutter

Resolving dependencies... _flutterfire_internals 1.3.2 (1.3.11 available) cached_network_image 3.2.1 (3.3.0 available) cached_network_image_platform_interface 1.0.0 (3.0.0 available) cached_network_image_web 1.0.1 (1.1.0 available) cloud_firestore 4.8.0 (4.12.2 available) cloud_firestore_platform_interface 5.15.0 (6.0.3 available) cloud_firestore_web 3.6.0 (3.8.3 available) collection 1.17.2 (1.18.0 available) csv 5.0.1 (5.1.1 available) dropdown_button2 2.0.0 (2.3.9 available) easy_debounce 2.0.1 (2.0.3 available) file 6.1.4 (7.0.0 available) firebase_analytics 10.4.2 (10.6.3 available) firebase_analytics_platform_interface 3.6.2 (3.7.5 available) firebase_analytics_web 0.5.4+2 (0.5.5+5 available) firebase_auth 4.6.2 (4.12.1 available) firebase_auth_platform_interface 6.15.2 (7.0.3 available) firebase_auth_web 5.5.2 (5.8.6 available) firebase_core 2.13.1 (2.21.0 available) firebase_core_platform_interface 4.8.0 (5.0.0 available) firebase_core_web 2.5.0 (2.8.1 available) firebase_crashlytics 3.3.2 (3.4.3 available) firebase_crashlytics_platform_interface 3.6.2 (3.6.11 available) firebase_performance 0.9.2+2 (0.9.3+3 available) firebase_performance_platform_interface 0.1.4+2 (0.1.4+11 available) firebase_performance_web 0.1.4+2 (0.1.4+11 available) flutter_animate 4.1.1+1 (4.2.0+1 available) flutter_cache_manager 3.3.0 (3.3.1 available) flutter_lints 3.0.0 (3.0.1 available) flutter_secure_storage 8.0.0 (9.0.0 available) flutter_secure_storage_windows 2.1.1 (3.0.0 available) font_awesome_flutter 10.1.0 (10.6.0 available) google_fonts 4.0.3 (6.1.0 available) google_sign_in 6.0.2 (6.1.5 available) google_sign_in_android 6.1.8 (6.1.20 available) google_sign_in_ios 5.6.1 (5.6.4 available) google_sign_in_platform_interface 2.4.0 (2.4.2 available) google_sign_in_web 0.11.0+2 (0.12.1 available) http 0.13.6 (1.1.0 available) image 4.0.17 (4.1.3 available) iregexp 0.1.1 (0.1.2 available) json_path 0.6.2 (0.6.6 available) lottie 1.2.1 (2.7.0 available) material_color_utilities 0.5.0 (0.8.0 available) meta 1.9.1 (1.11.0 available) octo_image 1.0.2 (2.0.0 available) page_transition 2.0.4 (2.1.0 available) path_provider 2.0.14 (2.1.1 available) path_provider_android 2.0.25 (2.2.1 available) path_provider_foundation 2.2.2 (2.3.1 available) path_provider_linux 2.1.11 (2.2.1 available) path_provider_platform_interface 2.0.6 (2.1.1 available) path_provider_windows 2.1.7 (2.2.1 available) permission_handler_android 11.1.0 (12.0.1 available) permission_handler_platform_interface 3.12.0 (4.0.2 available) petitparser 5.4.0 (6.0.1 available) pin_code_fields 7.4.0 (8.0.1 available) provider 6.0.4 (6.0.5 available) rfc_6901 0.1.1 (0.2.0 available) share_plus 6.3.1 (7.2.1 available) shared_preferences 2.0.15 (2.2.2 available) shared_preferences_android 2.1.0 (2.2.1 available) shared_preferences_ios 2.1.1 (discontinued replaced by shared_preferences_foundation) shared_preferences_linux 2.2.0 (2.3.2 available) shared_preferences_platform_interface 2.2.0 (2.3.1 available) shared_preferences_web 2.1.0 (2.2.1 available) shared_preferences_windows 2.2.0 (2.3.2 available) sign_in_with_apple 4.3.0 (5.0.0 available) sqflite 2.2.6 (2.3.0 available) stack_trace 1.11.0 (1.11.1 available) stream_channel 2.1.1 (2.1.2 available) test_api 0.6.0 (0.6.1 available) timeago 3.2.2 (3.6.0 available) url_launcher 6.1.10 (6.2.1 available) url_launcher_android 6.0.27 (6.2.0 available) url_launcher_ios 6.1.4 (6.2.0 available) url_launcher_linux 3.0.6 (3.1.0 available) url_launcher_macos 3.0.7 (3.1.0 available) url_launcher_platform_interface 2.1.2 (2.2.0 available) url_launcher_web 2.1.0 (2.2.0 available) url_launcher_windows 3.0.8 (3.1.0 available) uuid 3.0.7 (4.2.1 available) web 0.1.4-beta (0.3.0 available) win32 3.1.4 (5.0.9 available) xml 6.3.0 (6.4.2 available) Got dependencies!

Upgrading build.gradle Running Gradle task 'bundleRelease'...
Font asset "MaterialIcons-Regular.otf" was tree-shaken, reducing it from 1645184 to 3088 bytes (99.8% reduction). Tree-shaking can be disabled by providing the --no-tree-shake-icons flag when building your app. Note: /Users/builder/.pub-cache/hosted/pub.dev/cloud_firestore-4.8.0/android/src/main/java/io/flutter/plugins/firebase/firestore/FlutterFirebaseFirestoreMessageCodec.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: /Users/builder/.pub-cache/hosted/pub.dev/cloud_firestore-4.8.0/android/src/main/java/io/flutter/plugins/firebase/firestore/FlutterFirebaseFirestoreMessageCodec.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. /Users/builder/clone/android/app/src/main/AndroidManifest.xml Error: uses-sdk:minSdkVersion 21 cannot be smaller than version 26 declared in library [:mek_stripe_terminal] /Users/builder/clone/build/mek_stripe_terminal/intermediates/merged_manifest/release/AndroidManifest.xml as the library might be using APIs not available in 21 Suggestion: use a compatible library with a minSdk of at most 21, or increase this project's minSdk version to at least 26, or use tools:overrideLibrary="mek.stripeterminal" to force usage (may lead to runtime failures)

FAILURE: Build failed with an exception.

BUILD FAILED in 2m 28s Running Gradle task 'bundleRelease'... 149.6s

┌─ Flutter Fix ─────────────────────────────────────────────────────────────────────────────────┐ │ The plugin mek_stripe_terminal requires a higher Android SDK version. │ │ Fix this issue by adding the following to the file │ │ /Users/builder/clone/android/app/build.gradle: │ │ android { │ │ defaultConfig { │ │ minSdkVersion 26 │ │ } │ │ } │ │ │ │ Following this change, your app will not be available to users running Android SDKs below 26. │ │ 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 bundleRelease failed with exit code 1

Build failed :| Step 7 script Build AAB with Flutter exited with status code 1

Additional Info

No response

Environment

- FlutterFlow version: 4.0
- Platform: Android
- Browser name and version: Chrome 118.0.5993.118 
- Operating system and version affected: Windows 11
github-actions[bot] commented 9 months ago

This issue is stale because it has been open for 7 days with no activity. If there are no further updates, a team member will close the issue.

payminty-shaun commented 9 months ago

Hi @hariprasadms / @agreaves, can I please get an update on this issue to keep it open please?

This issue is directly impacting me, and adding the option to edit the minSdkVersion would help me a lot thank you and I don't believe would add much risk to your product.

Thanks!

hariprasadms commented 9 months ago

Hi @payminty-shaun - Thanks for submitting the issue. At this stage, android SDK version not able to change inside editor. There is a work around that pushing the code to git repository and modify the bit of code you required and deploy from outside to stores. However, you can create a feature request under help section, so that the request goes to correct channel and team consider for next steps. I hope this can help you. Thanks

payminty-shaun commented 9 months ago

Hi @payminty-shaun - Thanks for submitting the issue. At this stage, android SDK version not able to change inside editor. There is a work around that pushing the code to git repository and modify the bit of code you required and deploy from outside to stores. However, you can create a feature request under help section, so that the request goes to correct channel and team consider for next steps. I hope this can help you. Thanks

Thanks @hariprasadms, I have done so. Appreciate your help.