flet icon indicating copy to clipboard operation
flet copied to clipboard

label setting not working for android app

Open NHLOCAL opened this issue 1 year ago • 0 comments

Duplicate Check

  • [X] I have searched the opened issues and there are no duplicates

Describe the bug

When building an Android app, the product parameter defines both the app name for the package name and the name for the label that is displayed to users. The description and project parameters are actually being ignored.

This is problematic when I want to define a name that contains a space or characters in languages ​​other than English, but the build encounters an error because the name does not conform to standard dart format.

When I edited the AndroidManifest.xml file manually, the build worked fine with the custom name I wanted.

It seems that the name definition in flet-build-template gets the name from the product parameter instead of the project parameter.

Code

flet build apk myapp --project "myapp" --description "my app" --product "my app"

To reproduce

  1. Running the above code
  2. Getting an error that the format is not supported by dart
[12:47:16] Created Flutter bootstrap project from gh:flet-dev/flet-build-template with ref 0.23.1 ✅
           Customized app icons and splash images ✅
           Error on line 60, column 7 of pubspec.yaml: "name" field must be a valid Dart identifier.
              ╷
           60 │ name: my app
              │       ^^^^^^
              ╵

[12:47:17] Error building Flet app - see the log of failed command above.

Operating System

Windows

Operating system details

11

Flet version

0.23.1

Regression

No, it isn't

Additional details

According to the help documentation of the CLI tool, the project parameter is for "project name for executable or bundle" while the product parameter is for "project display name that is shown in window titles and about app dialogs". In practice the project parameter is used for both uses

NHLOCAL avatar Jul 05 '24 09:07 NHLOCAL