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

Flet --build apk command not working in version 0.25.x #4564

Open
1 task done
omamkaz opened this issue Dec 13, 2024 · 6 comments
Open
1 task done

Flet --build apk command not working in version 0.25.x #4564

omamkaz opened this issue Dec 13, 2024 · 6 comments
Assignees
Labels
bug Something isn't working has-upstream This issue depends on an upstream issue packaging Related to app packaging

Comments

@omamkaz
Copy link
Contributor

omamkaz commented Dec 13, 2024

Duplicate Check

Describe the bug

/home/runner/.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
/home/runner/.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.

Code sample

Code
[Paste your code here]

To reproduce

No, Details

Expected behavior

No response

Screenshots / Videos

Captures

[Upload media here]

Operating System

Linux

Operating system details

ubuntu-latest

Flet version

0.25.0

Regression

Yes, it used to work in a previous Flet version (please specify the version in additional details)

Suggestions

No response

Logs

Logs
╔════════════════════════════════════════════════════════════════════════════╗
  ║                 Welcome to Flutter! - https://flutter.dev/                  ║
  ║                                                                            ║
  ║ The Flutter tool uses Google Analytics to anonymously report feature usage ║
  ║ statistics and basic crash reports. This data is used to help improve      ║
  ║ Flutter tools over time.                                                   ║
  ║                                                                            ║
  ║ Flutter tool analytics are not sent on the very first run. To disable      ║
  ║ reporting, type 'flutter config --no-analytics'. To display the current    ║
  ║ setting, type 'flutter config'. If you opt out of analytics, an opt-out    ║
  ║ event will be sent, and then no further information will be sent by the    ║
  ║ Flutter tool.                                                              ║
  ║                                                                            ║
  ║ By downloading the Flutter SDK, you agree to the Google Terms of Service.  ║
  ║ The Google Privacy Policy describes how data is handled in this service.   ║
  ║                                                                            ║
  ║ Moreover, Flutter includes the Dart SDK, which may send usage metrics and  ║
  ║ crash reports to Google.                                                   ║
  ║                                                                            ║
  ║ Read about data we send with crash reports:                                ║
  ║ https://flutter.dev/to/crash-reporting                                     ║
  ║                                                                            ║
  ║ See Google's privacy policy:                                               ║
  ║ https://policies.google.com/privacy                                        ║
  ║                                                                            ║
  ║ To disable animations in this tool, use                                    ║
  ║ 'flutter config --no-cli-animations'.                                      ║
  ╚════════════════════════════════════════════════════════════════════════════╝

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.24.3, on Ubuntu 24.04.1 LTS 6.8.0-1017-azure, locale C.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
[✓] Chrome - develop for the web
[✓] Linux toolchain - develop for Linux desktop
[!] Android Studio (not installed)
[✓] Connected device (2 available)
[✓] Network resources

! Doctor found issues in 1 category.
Analytics reporting disabled.

You may need to restart any open editors for them to read new settings.
[15:37:50] Additional Flutter dependencies: {'flet_lottie': 'any'}              
           Created Flutter bootstrap project from                               
           gh:flet-dev/flet-build-template with ref 0.25.1 ✅                   
           Copying /home/runner/work/ynet/ynet/src/assets/icon.png to           
           /home/runner/work/ynet/ynet/build/flutter/images                     
           Customized app icons and splash images ✅                            
           Run subprocess:                                                      
           ['/opt/hostedtoolcache/flutter/stable-3.24.3-x64/bin/cache/dart-sdk/b
           in/dart', 'run', 'flutter_launcher_icons']                           
  ════════════════════════════════════════════
     FLUTTER LAUNCHER ICONS (v0.14.2)                               
  ════════════════════════════════════════════
  
• Creating default icons Android
• Overwriting the default Android launcher icon with a new icon
• Creating adaptive icons Android
• No colors.xml file found in your Android project
• Creating colors.xml file and adding it to your Android project
• Creating mipmap xml file Android
• Overwriting default iOS launcher icon with new icon
Creating Icons for Web...
Creating Icons for Windows...
Creating Icons for MacOS...

✓ Successfully generated launcher icons
[15:38:03] Generated app icons ✅                                               
           Run subprocess:                                                      
           ['/opt/hostedtoolcache/flutter/stable-3.24.3-x64/bin/cache/dart-sdk/b
           in/dart', 'run', 'flutter_native_splash:create']                     
[Android] Creating default splash images
[Android] Creating dark mode splash images
[Android] Creating default android12splash images
[Android] Creating dark mode android12splash images
[Android] Updating launch background(s) with splash image path...
[Android]  - android/app/src/main/res/drawable/launch_background.xml
[Android]  - android/app/src/main/res/drawable-night/launch_background.xml
[Android]  - android/app/src/main/res/drawable-v21/launch_background.xml
[Android]  - android/app/src/main/res/drawable-night-v21/launch_background.xml
[Android] Updating styles...
[Android]  - android/app/src/main/res/values-v31/styles.xml
[Android] No android/app/src/main/res/values-v31/styles.xml found in your Android project
[Android] Creating android/app/src/main/res/values-v31/styles.xml and adding it to your Android project
[Android]  - android/app/src/main/res/values-night-v31/styles.xml
[Android] No android/app/src/main/res/values-night-v31/styles.xml found in your Android project
[Android] Creating android/app/src/main/res/values-night-v31/styles.xml and adding it to your Android project
[Android]  - android/app/src/main/res/values/styles.xml
[Android]  - android/app/src/main/res/values-night/styles.xml
[iOS] Creating  images
[iOS] Creating dark mode  images
[iOS] Updating ios/Runner/Info.plist for status bar hidden/visible
[Web] Creating images
[Web] Creating images
[Web] Creating background images
[Web] Creating CSS
[Web] Updating index.html

✅ Native splash complete.
Now go finish building something awesome! 💪 You rock! 🤘🤩
Like the package? Please give it a 👍 here: https://pub.dev/packages/flutter_native_splash

[15:38:09] Generated splash screens ✅                                          
           Run subprocess:                                                      
           ['/opt/hostedtoolcache/flutter/stable-3.24.3-x64/bin/cache/dart-sdk/b
           in/dart', 'run', 'serious_python:main', 'package',                   
           '/home/runner/work/ynet/ynet/src', '--platform', 'Android', '--arch',
           'arm64-v8a', '--requirements',                                       
           'bs4==0.0.2,flet==0.25.0,humanize==4.10.0,pydal==20241201.2,requests=
           =2.32.3', '--exclude', 'build', '--compile-app', '--cleanup']        
Running package command
Extra PyPi indexes: [https://pypi.flet.dev/]
Creating asset directory: /home/runner/work/ynet/ynet/build/flutter/app
Created temp directory: /tmp/serious_python_tempTTUGRM
Copying Python app from /home/runner/work/ynet/ynet/src to a temp directory
Compiling Python sources in a temp directory
Downloading Python distributive from https://github.com/indygreg/python-build-standalone/releases/download/20240909/cpython-3.12.6+20240909-x86_64-unknown-linux-gnu-install_only_stripped.tar.gz to a build directory
Extracting Python distributive
Cleanup app
Configured Android/arm64-v8a platform with sitecustomize.py
Installing [bs4==0.0.2, flet==0.25.0, humanize==4.10.0, pydal==20241201.2, requests==2.32.3] with pip command to /home/runner/work/ynet/ynet/build/site-packages/arm64-v8a
Cleanup installed packages
Creating app archive at /home/runner/work/ynet/ynet/build/flutter/app/app.zip from a temp directory
Writing app archive hash to /home/runner/work/ynet/ynet/build/flutter/app/app.zip.hash
Deleting temp directory
[15:38:17] Packaged Python app ✅                                               
           Run subprocess:                                                      
           ['/opt/hostedtoolcache/flutter/stable-3.24.3-x64/bin/flutter',       
           'build', 'apk', '--split-per-abi', '--build-number', '1734101761',   
           '--build-name', '12.0.0']                                            
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)
  lottie 3.2.0 (3.3.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.
21 packages have newer versions incompatible with dependency constraints.
Try `flutter pub outdated` for more information.

Running Gradle task 'assembleRelease'...                        
Warning: Errors during XML parse:
Warning: Additionally, the fallback loader failed to parse the XML.
Checking the license for package NDK (Side by side) 25.1.8937393 in /usr/local/lib/android/sdk/licenses
License for package NDK (Side by side) 25.1.8937393 accepted.
Preparing "Install NDK (Side by side) 25.1.8937393 v.25.1.8937393".
"Install NDK (Side by side) 25.1.8937393 v.25.1.8937393" ready.
Installing NDK (Side by side) 25.1.8937393 in /usr/local/lib/android/sdk/ndk/25.1.8937393
"Install NDK (Side by side) 25.1.8937393 v.25.1.8937393" complete.
"Install NDK (Side by side) 25.1.8937393 v.25.1.8937393" finished.
Checking the license for package Android SDK Platform 31 in /usr/local/lib/android/sdk/licenses
License for package Android SDK Platform 31 accepted.
Preparing "Install Android SDK Platform 31 (revision 1)".
"Install Android SDK Platform 31 (revision 1)" ready.
Installing Android SDK Platform 31 in /usr/local/lib/android/sdk/platforms/android-31
"Install Android SDK Platform 31 (revision 1)" complete.
"Install Android SDK Platform 31 (revision 1)" finished.
Checking the license for package Android SDK Platform 33 in /usr/local/lib/android/sdk/licenses
License for package Android SDK Platform 33 accepted.
Preparing "Install Android SDK Platform 33 (revision 3)".
"Install Android SDK Platform 33 (revision 3)" ready.
Installing Android SDK Platform 33 in /usr/local/lib/android/sdk/platforms/android-33
"Install Android SDK Platform 33 (revision 3)" complete.
"Install Android SDK Platform 33 (revision 3)" finished.
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.
warning: [options] source value 8 is obsolete and will be removed in a future release
warning: [options] target value 8 is obsolete and will be removed in a future release
warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
/home/runner/.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
/home/runner/.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 6m 22s
Running Gradle task 'assembleRelease'...                          383.6s
Gradle task assembleRelease failed with exit code 1
[15:44:43] Error building Flet app - see the log of failed command above.       
           Run subprocess:                                                      
           ['/opt/hostedtoolcache/flutter/stable-3.24.3-x64/bin/flutter',       
           '--version']                                                         
           Run subprocess:                                                      
           ['/opt/hostedtoolcache/flutter/stable-3.24.3-x64/bin/flutter',       
           'doctor']                                                            
[15:44:46] Doctor summary (to see all details, run flutter doctor -v):          
           [✓] Flutter (Channel stable, 3.24.3, on Ubuntu 24.04.1 LTS           
           6.8.0-1017-azure, locale C.UTF-8)                                    
           [✓] Android toolchain - develop for Android devices (Android SDK     
           version 35.0.0)                                                      
           [✓] Chrome - develop for the web                                     
           [✓] Linux toolchain - develop for Linux desktop                      
           [!] Android Studio (not installed)                                   
           [✓] Connected device (2 available)                                   
           [✓] Network resources                                                
                                                                                
           ! Doctor found issues in 1 category.                                 
                                                                                
Error: Process completed with exit code 1.

Additional details

The last version I used that flet --build was working is = 0.24.1

The commands I used to build the flet app

  flutter doctor
  flutter config --no-analytics
  flet build apk \
  --verbose \
  --split-per-abi \
  --compile-app \
  --cleanup-on-compile \
  --android-adaptive-icon-background="#ffffff" \
  --include-packages flet_lottie \
  --build-number="$BUILD_NUMBER" \
  --build-version="$BUILD_VERSION" \
  --company="$COMPANY_NAME" \
  --org="$ORG_NAME" \
  --product="$PRODUCT" \
  --description="$DESCRIPTION" \
  --project="$PROJECT" \
  --arch=arm64-v8a
@ksgrande88
Copy link

I'm getting the same filepicker package error with flet 25.1. can't build APK or AAB

@fckfck97
Copy link

I was compiling normal but I updated the flutter and when compiling I get that same filepicker error on mac how could it be fixed

@ndonkoHenri ndonkoHenri mentioned this issue Dec 14, 2024
1 task
@cheny09
Copy link

cheny09 commented Dec 14, 2024

Add these lines to your pyproject.toml file

[tool.flet.flutter.pubspec.dependency_overrides]
file_picker = "8.1.4"

@omamkaz
Copy link
Contributor Author

omamkaz commented Dec 14, 2024

Add these lines to your pyproject.toml file

[tool.flet.flutter.pubspec.dependency_overrides] file_picker = "8.1.4"

It's working, thanks :)

@ndonkoHenri ndonkoHenri self-assigned this Dec 15, 2024
@ndonkoHenri ndonkoHenri added bug Something isn't working packaging Related to app packaging labels Dec 15, 2024
@ndonkoHenri
Copy link
Contributor

ndonkoHenri commented Dec 15, 2024

Thanks for the solution and feedback.
Will bump the version of file_picker we use to 8.1.4.

Upstream issue: miguelpruivo/flutter_file_picker#1643

@ndonkoHenri ndonkoHenri added the has-upstream This issue depends on an upstream issue label Dec 15, 2024
@FeodorFitsner
Copy link
Contributor

Updated app build template with file_picker: 8.1.4

Weird, I'm getting "registrar" error again with file_picker: 8.1.5. Regression?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working has-upstream This issue depends on an upstream issue packaging Related to app packaging
Projects
Status: 🆕 New
Development

No branches or pull requests

7 participants
@FeodorFitsner @fckfck97 @cheny09 @omamkaz @ndonkoHenri @ksgrande88 and others