flet v0.25.1 build apk fails, cannot find symbol registrar.addActivityResultListener(this.delegate) #4555
Replies: 3 comments 3 replies
-
| I have the same problem, this error occurs even on the new Hello world project, version: flet==0.24.1 | 
Beta Was this translation helpful? Give feedback.
-
| I have the same issue (●     ) Building .apk for Android ⏳...         if (registrar != null) { in another github Discussions some developers set the package file_picker to version 8.1.4 to solve this inssue. | 
Beta Was this translation helpful? Give feedback.
-
| We have an opened issue concerning this here: #4564 | 
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Question
I need some help with a build error that I cannot resolve. My app uses the FilePicker control and I get a an error when building the apk:
I get the same error if I comment out the FilePicker controls and everything related to them.
Flutter Doctor:
I've tried different versions of the Android SDK (35) as well as flutter (3.24.0 - 3.24.5)
Any help is appreciated 😊
Code sample
No response
Error message
flet build apk [12:34:04] Created Flutter bootstrap project from gh:flet-dev/flet-build-template with ref 0.25.1 ✅ Customized app icons and splash images ✅ [12:34:26] Generated app icons ✅ [12:34:31] Generated splash screens ✅ [12:35:53] Packaged Python app ✅ [12:37:32] 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.18.0 (1.19.1 available) flutter_lints 2.0.3 (5.0.0 available) http_parser 4.0.2 (4.1.1 available) image 4.3.0 (4.4.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) shelf 1.4.1 (1.4.2 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. 20 packages have newer versions incompatible with dependency constraints. Try `flutter pub outdated` for more information. Running Gradle task 'assembleRelease'... Font asset "CupertinoIcons.ttf" was tree-shaken, reducing it from 257628 to 209160 bytes (18.8% reduction). Tree-shaking can be disabled by providing the --no-tree-shake-icons flag when building your app. Font asset "MaterialIcons-Regular.otf" was tree-shaken, reducing it from 1645184 to 1261080 bytes (23.3% reduction). Tree-shaking can be disabled by providing the --no-tree-shake-icons flag when building your app. Running Gradle task 'assembleRelease'... 96.0s warning: source value 8 is obsolete and will be removed in a future release warning: target value 8 is obsolete and will be removed in a future release warning: To suppress warnings about obsolete options, use -Xlint:-options. 3 warnings warning: source value 8 is obsolete and will be removed in a future release warning: target value 8 is obsolete and will be removed in a future release warning: To suppress warnings about obsolete options, use -Xlint:-options. C:\Users\username\AppData\Local\Pub\Cache\hosted\pub.dev\file_picker-8.1.5\android\src\main\java\com\mr\flutter \plugin\filepicker\FilePickerPlugin.java:257: error: cannot find symbol if (registrar != null) { ^ symbol: variable registrar location: class FilePickerPlugin C:\Users\username\AppData\Local\Pub\Cache\hosted\pub.dev\file_picker-8.1.5\android\src\main\java\com\mr\flutter \plugin\filepicker\FilePickerPlugin.java:260: error: cannot find symbol registrar.addActivityResultListener(this.delegate); ^ symbol: variable registrar location: class FilePickerPlugin 2 errors 3 warnings FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':file_picker:compileReleaseJavaWithJavac'. > Compilation failed; see the compiler error output for details. * Try: > Run with --info option to get more log output. > Run with --scan to get full insights. BUILD FAILED in 1m 35s Gradle task assembleRelease failed with exit code 1 Error building Flet app - see the log of failed command above. [12:37:41] Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 3.24.3, on Microsoft Windows [Version 10.0.22631.4602], locale en-US) [✓] 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 Build Tools 2022 17.11.5) [✓] Android Studio (version 2024.2) [✓] VS Code (version 1.96.0) [✓] Connected device (3 available) [✓] Network resources • No issues found!------------------------------------------------------
Beta Was this translation helpful? Give feedback.
All reactions