Skip to content

Conversation

@SamYuan1990
Copy link

@SamYuan1990 SamYuan1990 commented Sep 10, 2025

try to fix flet-dev/flet#5630 in temp

@CLAassistant
Copy link

CLAassistant commented Sep 10, 2025

CLA assistant check
All committers have signed the CLA.

@SamYuan1990 SamYuan1990 force-pushed the webview_flutter_androidfix branch 2 times, most recently from 1ff59e0 to 5131f03 Compare September 10, 2025 06:03
Signed-off-by: SamYuan1990 <[email protected]>
@SamYuan1990 SamYuan1990 force-pushed the webview_flutter_androidfix branch from 5131f03 to 9c8f332 Compare September 10, 2025 06:04
@SamYuan1990
Copy link
Author

SamYuan1990 commented Sep 10, 2025

tested at https://github.com/SamYuan1990/i18n-agent-action/pull/99, it works for mac, linux, windows to build package.

@SamYuan1990
Copy link
Author

now it turns to another issue as

FAILURE: Build failed with an exception.                             
                                                                                
           * What went wrong:                                                   
           Execution failed for task ':app:processReleaseMainManifest'.         
           > Manifest merger failed : uses-sdk:minSdkVersion 21 cannot be       
           smaller than version 24 declared in library [:url_launcher_android]  
           /home/runner/work/i18n-agent-action/i18n-agent-action/App/build/flutt
           er/build/url_launcher_android/intermediates/merged_manifest/release/p
           rocessReleaseManifest/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
           24,                                                                  
                           or use                                               
           tools:overrideLibrary="io.flutter.plugins.urllauncher" 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 7m 14s                                               
           Running Gradle task 'assembleRelease'...                             
           435.4s                                                               
                                                                                
           ┌─ Flutter Fix                                                       
           ─────────────────────────────────────────────────────────────────────
           ───────────────┐                                                     
           │ The plugin url_launcher_android requires a higher Android SDK      
           version.                           │                                 
           │ Fix this issue by adding the following to the file                 
           │                                                                    
           │                                                                    
           /home/runner/work/i18n-agent-action/i18n-agent-action/App/build/flutt
           er/android/app/build.gradle │                                        
           │ :                                                                  
           │                                                                    
           │ android {                                                          
           │                                                                    
           │   defaultConfig {                                                  
           │                                                                    
           │     minSdkVersion 24                                               
           │                                                                    
           │   }                                                                
           │                                                                    
           │ }                                                                  
           │                                                                    
           │                                                                    
           │                                                                    
           │ Following this change, your app will not be available to users     
           running Android SDKs below 24.    │                                  
           │ Consider searching for a version of this plugin that supports these
           lower versions of the        │                                       
           │ Android SDK instead.                                               
           │                                                                    
           │ For more information, see:                                         
           https://flutter.dev/to/review-gradle-config                          
           │                                                                    
           └────────────────────────────────────────────────────────────────────
           ──────────────────────────────┘                                      
           Gradle task assembleRelease failed with exit code 1                  
           <_io.TextIOWrapper name=5 encoding='utf-8'>                          
           Run subprocess: ['/home/runner/flutter/3.29.2/bin/flutter', 'doctor',
           '--no-version-check', '--suppress-analytics']

@SamYuan1990
Copy link
Author

now it turns to another issue as

FAILURE: Build failed with an exception.                             
                                                                                
           * What went wrong:                                                   
           Execution failed for task ':app:processReleaseMainManifest'.         
           > Manifest merger failed : uses-sdk:minSdkVersion 21 cannot be       
           smaller than version 24 declared in library [:url_launcher_android]  
           /home/runner/work/i18n-agent-action/i18n-agent-action/App/build/flutt
           er/build/url_launcher_android/intermediates/merged_manifest/release/p
           rocessReleaseManifest/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
           24,                                                                  
                           or use                                               
           tools:overrideLibrary="io.flutter.plugins.urllauncher" 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 7m 14s                                               
           Running Gradle task 'assembleRelease'...                             
           435.4s                                                               
                                                                                
           ┌─ Flutter Fix                                                       
           ─────────────────────────────────────────────────────────────────────
           ───────────────┐                                                     
           │ The plugin url_launcher_android requires a higher Android SDK      
           version.                           │                                 
           │ Fix this issue by adding the following to the file                 
           │                                                                    
           │                                                                    
           /home/runner/work/i18n-agent-action/i18n-agent-action/App/build/flutt
           er/android/app/build.gradle │                                        
           │ :                                                                  
           │                                                                    
           │ android {                                                          
           │                                                                    
           │   defaultConfig {                                                  
           │                                                                    
           │     minSdkVersion 24                                               
           │                                                                    
           │   }                                                                
           │                                                                    
           │ }                                                                  
           │                                                                    
           │                                                                    
           │                                                                    
           │ Following this change, your app will not be available to users     
           running Android SDKs below 24.    │                                  
           │ Consider searching for a version of this plugin that supports these
           lower versions of the        │                                       
           │ Android SDK instead.                                               
           │                                                                    
           │ For more information, see:                                         
           https://flutter.dev/to/review-gradle-config                          
           │                                                                    
           └────────────────────────────────────────────────────────────────────
           ──────────────────────────────┘                                      
           Gradle task assembleRelease failed with exit code 1                  
           <_io.TextIOWrapper name=5 encoding='utf-8'>                          
           Run subprocess: ['/home/runner/flutter/3.29.2/bin/flutter', 'doctor',
           '--no-version-check', '--suppress-analytics']

fixed by

[tool.flet.android]
min_sdk_version = 24

@RobertDeRose
Copy link

RobertDeRose commented Sep 10, 2025

@SamYuan1990 I was able to do the same thing as your template PR by just adding to my pyproject.toml

[tool.flet.android]
min_sdk_version = 24

[tool.flet.flutter.pubspec.dependency_overrides]
webview_flutter_android = "4.10.1"

And now my builds work again. Thank to you for this PR and information about the SDK, cause the error message I was getting during the build made no sense to me

@SamYuan1990
Copy link
Author

@SamYuan1990 I was able to do the same thing as your template PR by just adding to my pyproject.toml

[tool.flet.android]
min_sdk_version = 24

[tool.flet.flutter.pubspec.dependency_overrides]
webview_flutter_android = "4.10.1"

And now my builds work again. Thank to you for this PR and information about the SDK, cause the error message I was getting during the build made no sense to me

thanks to let me know there is tool.flet.flutter.pubspec.dependency_overrides

@djefferson-saintilus
Copy link

djefferson-saintilus commented Sep 11, 2025

its work for me also just copy paste into toml file and thats it

[tool.flet.android]
min_sdk_version = 24

[tool.flet.flutter.pubspec.dependency_overrides]
webview_flutter_android = "4.10.1"

@Progressing-Llama
Copy link

Progressing-Llama commented Sep 11, 2025

worked for me. I was getting the following error:

 flet build windows
[16:01:50] Flutter 3.29.2 installed ✅
[16:01:55] Created Flutter bootstrap project from gh:flet-dev/flet-build-template with ref "0.28.3" ✅
[16:01:57] Packaged Python app ✅
           Registered Flutter user extensions ✅
[16:02:06] Generated app icons ✅
[16:02:34]
           windows/flutter/CMakeLists.txt does not use FLUTTER_TARGET_PLATFORM, updating.
           Building Windows application...
           Building Windows application...                                    26.1s

           ../../../../../../../AppData/Local/Pub/Cache/hosted/pub.dev/webview_flutter_android-4.10.2/lib/webview_flutte
           r_android.dart(1,1): error G97AC55BA: The language version 3.9 specified for the package
           'webview_flutter_android' is too high. The highest supported language version is 3.7.
           [C:\Users\rykli\OneDrive\Documents\Flet-Extensions\examples\flet_textfield_cursor_example\build\flutter\build
           \windows\x64\flutter\flutter_assemble.vcxproj]
           ../../../../../../../AppData/Local/Pub/Cache/hosted/pub.dev/webview_flutter_android-4.10.2/lib/src/android_ss
           l_auth_error.dart(1,1): error G97AC55BA: The language version 3.9 specified for the package
           'webview_flutter_android' is too high. The highest supported language version is 3.7.
           [C:\Users\rykli\OneDrive\Documents\Flet-Extensions\examples\flet_textfield_cursor_example\build\flutter\build
           \windows\x64\flutter\flutter_assemble.vcxproj]
           ../../../../../../../AppData/Local/Pub/Cache/hosted/pub.dev/webview_flutter_android-4.10.2/lib/src/android_we
           bview_controller.dart(1,1): error G97AC55BA: The language version 3.9 specified for the package
           'webview_flutter_android' is too high. The highest supported language version is 3.7.
           [C:\Users\rykli\OneDrive\Documents\Flet-Extensions\examples\flet_textfield_cursor_example\build\flutter\build
           \windows\x64\flutter\flutter_assemble.vcxproj]
           ../../../../../../../AppData/Local/Pub/Cache/hosted/pub.dev/webview_flutter_android-4.10.2/lib/src/android_we
           bview_cookie_manager.dart(1,1): error G97AC55BA: The language version 3.9 specified for the package
           'webview_flutter_android' is too high. The highest supported language version is 3.7.
           [C:\Users\rykli\OneDrive\Documents\Flet-Extensions\examples\flet_textfield_cursor_example\build\flutter\build
           \windows\x64\flutter\flutter_assemble.vcxproj]
           ../../../../../../../AppData/Local/Pub/Cache/hosted/pub.dev/webview_flutter_android-4.10.2/lib/src/android_we
           bview_platform.dart(1,1): error G97AC55BA: The language version 3.9 specified for the package
           'webview_flutter_android' is too high. The highest supported language version is 3.7.
           [C:\Users\rykli\OneDrive\Documents\Flet-Extensions\examples\flet_textfield_cursor_example\build\flutter\build
           \windows\x64\flutter\flutter_assemble.vcxproj]
           ../../../../../../../AppData/Local/Pub/Cache/hosted/pub.dev/webview_flutter_android-4.10.2/lib/src/android_we
           bkit.g.dart(1,1): error G97AC55BA: The language version 3.9 specified for the package
           'webview_flutter_android' is too high. The highest supported language version is 3.7.
           [C:\Users\rykli\OneDrive\Documents\Flet-Extensions\examples\flet_textfield_cursor_example\build\flutter\build
           \windows\x64\flutter\flutter_assemble.vcxproj]
           ../../../../../../../AppData/Local/Pub/Cache/hosted/pub.dev/webview_flutter_android-4.10.2/lib/src/android_pr
           oxy.dart(1,1): error G97AC55BA: The language version 3.9 specified for the package 'webview_flutter_android'
           is too high. The highest supported language version is 3.7.
           [C:\Users\rykli\OneDrive\Documents\Flet-Extensions\examples\flet_textfield_cursor_example\build\flutter\build
           \windows\x64\flutter\flutter_assemble.vcxproj]
           ../../../../../../../AppData/Local/Pub/Cache/hosted/pub.dev/webview_flutter_android-4.10.2/lib/src/android_we
           bkit_constants.dart(1,1): error G97AC55BA: The language version 3.9 specified for the package
           'webview_flutter_android' is too high. The highest supported language version is 3.7.
           [C:\Users\rykli\OneDrive\Documents\Flet-Extensions\examples\flet_textfield_cursor_example\build\flutter\build
           \windows\x64\flutter\flutter_assemble.vcxproj]
           ../../../../../../../AppData/Local/Pub/Cache/hosted/pub.dev/webview_flutter_android-4.10.2/lib/src/platform_v
           iews_service_proxy.dart(1,1): error G97AC55BA: The language version 3.9 specified for the package
           'webview_flutter_android' is too high. The highest supported language version is 3.7.
           [C:\Users\rykli\OneDrive\Documents\Flet-Extensions\examples\flet_textfield_cursor_example\build\flutter\build
           \windows\x64\flutter\flutter_assemble.vcxproj]
           ../../../../../../../AppData/Local/Pub/Cache/hosted/pub.dev/webview_flutter_android-4.10.2/lib/src/weak_refer
           ence_utils.dart(1,1): error G97AC55BA: The language version 3.9 specified for the package
           'webview_flutter_android' is too high. The highest supported language version is 3.7.
           [C:\Users\rykli\OneDrive\Documents\Flet-Extensions\examples\flet_textfield_cursor_example\build\flutter\build
           \windows\x64\flutter\flutter_assemble.vcxproj]
           C:\Program Files (x86)\Microsoft Visual
           Studio\2019\BuildTools\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(241,5): error MSB8066: Custom
           build for
           'C:\Users\rykli\OneDrive\Documents\Flet-Extensions\examples\flet_textfield_cursor_example\build\flutter\build
           \windows\x64\CMakeFiles\9b6262f3289bfab10fab654885ee54e8\flutter_windows.dll.rule;C:\Users\rykli\OneDrive\Doc
           uments\Flet-Extensions\examples\flet_textfield_cursor_example\build\flutter\build\windows\x64\CMakeFiles\9ab8
           93ad68bc1143261d1bc602d3d697\flutter_assemble.rule' exited with code 1.
           [C:\Users\rykli\OneDrive\Documents\Flet-Extensions\examples\flet_textfield_cursor_example\build\flutter\build
           \windows\x64\flutter\flutter_assemble.vcxproj]
           Build process failed.

[16:02:37] Doctor summary (to see all details, run flutter doctor -v):
           [✓] Flutter (Channel stable, 3.29.2, on Microsoft Windows [Version 10.0.26100.5074], locale en-ZA)
           [✓] Windows Version (11 Home 64-bit, 24H2, 2009)
           [!] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
               ✗ cmdline-tools component is missing
                 Run `path/to/sdkmanager --install "cmdline-tools;latest"`
                 See https://developer.android.com/studio/command-line for more details.
               ✗ Android license status unknown.
                 Run `flutter doctor --android-licenses` to accept the SDK licenses.
                 See https://flutter.dev/to/windows-android-setup for more details.
           [✓] Chrome - develop for the web
           [✓] Visual Studio - develop Windows apps (Visual Studio Build Tools 2019 16.11.38)
           [✓] Android Studio (version 2025.1.1)
           [✓] Connected device (3 available)
           [✓] Network resources

           ! Doctor found issues in 1 category.

╭──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ Error building Flet app - see the log of failed command above.                                                       │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

@breno-frizoni
Copy link

I was facing the same.
By changing pyproject.toml as above my workflow is working now. Thanks!

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

Successfully merging this pull request may close these issues.

6 participants