[Question] Error building Flet app on Windows: Issues with return types in theme.dart #4573
-
| QuestionHi, I’m trying to build a Flet app on Windows using the  Details: My environment: 
 Steps I’ve tried to resolve the issue: 
 Request for help: Thank you for your support! Code sampleNo response Error message(.venv) PS C:\Users\miner\DuzDev\prueba> flet build windows
[17:04:41] Created Flutter bootstrap project from gh:flet-dev/flet-build-template with ref 0.25.2 ✅
           Customized app icons and splash images ✅
[17:04:48] Generated app icons ✅
[17:05:10] Packaged Python app ✅
[17:05:51] Resolving dependencies...
           Downloading packages...
             archive 3.6.1 (4.0.1 available)
             characters 1.3.0 (1.4.0 available)
             clock 1.1.1 (1.1.2 available)
             collection 1.19.0 (1.19.1 available)
           ! file_picker 8.1.4 (overridden) (8.1.5 available)
             flutter_lints 2.0.3 (5.0.0 available)
             image 4.3.0 (4.5.0 available)
             intl 0.19.0 (0.20.1 available)
             js 0.6.7 (0.7.1 available)
             lints 2.1.1 (5.1.0 available)
             material_color_utilities 0.11.1 (0.12.0 available)
             meta 1.15.0 (1.16.0 available)
             path 1.9.0 (1.9.1 available)
             sensors_plus 4.0.2 (6.1.1 available)
             sensors_plus_platform_interface 1.2.0 (2.0.1 available)
             serious_python 0.8.3 (0.8.4 available)
             toml 0.15.0 (0.16.0 available)
             url_strategy 0.2.0 (discontinued)
           ! wakelock_plus 1.2.8 (overridden)
           ! web 1.1.0 (overridden)
             web_socket_channel 2.4.5 (3.0.1 available)
           ! window_manager 0.4.3 (overridden)
           Got dependencies!
           1 package is discontinued.
           19 packages have newer versions incompatible with dependency constraints.
           Try `flutter pub outdated` for more information.
           windows/flutter/CMakeLists.txt does not use FLUTTER_TARGET_PLATFORM, updating.
           Building Windows application...
           Building Windows application...                                    37.8s
           ../../../../AppData/Local/Pub/Cache/hosted/pub.dev/flet-0.25.2/lib/src/utils/theme.dart(356,28): error
           G44692867: A value of type 'TabBarThemeData' can't be returned from a function with return type
           'TabBarTheme?'.
           [C:\Users\miner\DuzDev\prueba\build\flutter\build\windows\x64\flutter\flutter_assemble.vcxproj]
           ../../../../AppData/Local/Pub/Cache/hosted/pub.dev/flet-0.25.2/lib/src/utils/theme.dart(438,28): error
           G44692867: A value of type 'DialogThemeData' can't be returned from a function with return type
           'DialogTheme?'.
           [C:\Users\miner\DuzDev\prueba\build\flutter\build\windows\x64\flutter\flutter_assemble.vcxproj]
           ../../../../AppData/Local/Pub/Cache/hosted/pub.dev/flet-0.25.2/lib/src/utils/theme.dart(482,26): error
           G44692867: A value of type 'CardThemeData' can't be returned from a function with return type 'CardTheme?'.
           [C:\Users\miner\DuzDev\prueba\build\flutter\build\windows\x64\flutter\flutter_assemble.vcxproj]
           C:\Program Files\Microsoft Visual
           Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(254,5): error MSB8066:
           Compilación personalizada de
           "C:\Users\miner\DuzDev\prueba\build\flutter\build\windows\x64\CMakeFiles\32618c91ec424f4b21051be03aaacc60\f
           lutter_windows.dll.rule;C:\Users\miner\DuzDev\prueba\build\flutter\build\windows\x64\CMakeFiles\97a3af39dde
           e685113b99ae8d51321ce\flutter_assemble.rule;C:\Users\miner\DuzDev\prueba\build\flutter\windows\flutter\CMak
           eLists.txt" terminada con el código 1.
           [C:\Users\miner\DuzDev\prueba\build\flutter\build\windows\x64\flutter\flutter_assemble.vcxproj]
           Build process failed.
           Error building Flet app - see the log of failed command above.
[17:05:56] Doctor summary (to see all details, run flutter doctor -v):
           [✓] Flutter (Channel stable, 3.27.0, on Microsoft Windows [Versi¢n 10.0.22631.4460], locale es-MX)
           [✓] Windows Version (Installed version of Windows is version 10 or higher)
           [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
           [✓] Chrome - develop for the web
           [✓] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.12.3)
           [✓] Android Studio (version 2024.2)
           [✓] VS Code (version 1.95.2)
           [✓] Connected device (3 available)
           [✓] Network resources
           • No issues found!------------------------------------------------------
 | 
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
| I have the same problem. just downgrade your flutter to version 3.24.0. it would be solved. | 
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
I have the same problem. just downgrade your flutter to version 3.24.0. it would be solved.