website icon indicating copy to clipboard operation
website copied to clipboard

Add application of app_name to 'Create flavors of a Flutter app' page for Android

Open hamishnorton opened this issue 1 year ago • 0 comments

Page URL

https://docs.flutter.dev/deployment/flavors/

Page source

https://github.com/flutter/website/tree/main/src/deployment/flavors.md

Describe the problem

In the section: https://docs.flutter.dev/deployment/flavors#setting-up-launch-configurations It suggests... resValue "string", "app_name", "free flavor example" ...for I assume setting the android:label. However, after: flutter build apk --flavor free, and running it, it still has the original name of the app, and not the one provided in the resValue.

Expected fix

Add information on how to have an android flavored app with a specific application name. Or change it to the likes of...

free {
            dimension "default"
            applicationIdSuffix ".free"
            versionNameSuffix "-free"
            manifestPlaceholders = [appLabel: "Free <YourApp>"]
        }

...and update the AndroidManifest.xml with... <application android:label="{appLabel}" android:name="${applicationName}" android:icon="@mipmap/launcher_icon">

Additional context

No response

I would like to fix this problem.

  • [ ] I will try and fix this problem on docs.flutter.dev.

hamishnorton avatar Mar 18 '24 22:03 hamishnorton