How can I change the app display name build with Flutter?

233,834

Solution 1

UPDATE: From the comments this answer seems to be out of date

The Flutter documentation points out where you can change the display name of your application for both Android and iOS. This may be what you are looking for:

For Android

It seems you have already found this in the AndroidManifest.xml as the application entry.

Review the default App Manifest file AndroidManifest.xml located in /android/app/src/main/ and verify the values are correct, especially:

application: Edit the android:label in the application tag to reflect the final name of the app.

For iOS

See the Review Xcode project settings section:

Navigate to your target’s settings in Xcode:

In Xcode, open Runner.xcworkspace in your app’s ios folder.

To view your app’s settings, select the Runner project in the Xcode project navigator. Then, in the main view sidebar, select the Runner target.

Select the General tab. Next, you’ll verify the most important settings:

Display Name: the name of the app to be displayed on the home screen and elsewhere.

Solution 2

Android

Open AndroidManifest.xml (located at android/app/src/main)

<application
    android:label="App Name" ...> // Your app name here

iOS

Open info.plist (located at ios/Runner)

<key>CFBundleName</key>
<string>App Name</string> // Your app name here

Don't forget to run

flutter clean

Solution 3

There is a plugin called flutter_launcher_name.

Write file pubspec.yaml:

dev_dependencies:
  flutter_launcher_name: "^0.0.1"

flutter_launcher_name:
  name: "yourNewAppLauncherName"

And run:

flutter pub get
flutter pub run flutter_launcher_name:main

You can get the same result as editing AndroidManifest.xml and Info.plist.

Solution 4

You can change it in iOS without opening Xcode by editing the project/ios/Runner/info.plist <key>CFBundleDisplayName</key> to the String that you want as your name.

FWIW - I was getting frustrated with making changes in Xcode and Flutter, so I started committing all changes before opening Xcode, so I could see where the changes show up in the Flutter project.

Solution 5

  • Review the default app manifest file, AndroidManifest.xml, located in <app dir>/android/app/src/main

  • Edit the android:label to your desired display name

Share:
233,834

Related videos on Youtube

rajaishwary
Author by

rajaishwary

Updated on April 12, 2022

Comments

  • rajaishwary
    rajaishwary about 2 years

    I have created the app using Flutter create testapp. Now, I want to change the app name from "testapp" to "My Trips Tracker". How can I do that?

    I have tried changing from the AndroidManifest.xml, and it got changed, but is there a way that Flutter provides to do that?

    • CommonsWare
      CommonsWare over 6 years
      The manifest is the only way to change the name that is shown in the Settings app and the name shown on your launcher icon.
    • Infinite Looper
      Infinite Looper about 5 years
      For visual people this video will show you the whole process youtube.com/watch?v=05twEATiS44
    • Jesus Hernandez Barrios
      Jesus Hernandez Barrios almost 3 years
      Use a plugin,it's easy, fast, secure,and already tested by the comunity, the flutter_app_name package it's a great option, and have support for null-safety. The other recommended package is flutter_launcher_name, but basically flutter_launcher_name don't support null safety, check the Null safety support.
  • rajaishwary
    rajaishwary over 6 years
    Yeah, thanks for the answer. I knew the native methods to do that. I was just curious to know if flutter handles it from a single point.
  • Pankaj Bansal
    Pankaj Bansal about 5 years
    These are native methods to do that. I want to know flutter handles it from a single point or not?
  • Johnykutty
    Johnykutty about 5 years
    @AshtonThomas I can change this but after cleaning rebuilding etc, runner app resets its value, how can I keep this?(As I understand Runner project is recreated after clean build or so)
  • iKK
    iKK about 5 years
    For Android, this does not work. Trying to change from <OldName> to <NewName>, the error message sais: Manifest merger failed : Attribute application@label value=(OldName) from AndroidManifest.xml:21:9-32 is also present at AndroidManifest.xml:21:9-32 value=(NewName).. What do you suggest ??
  • CopsOnRoad
    CopsOnRoad about 5 years
    You may have more than one AndroidManifest.xml file in your project, you will have to open the one located at android/app/src/main.
  • ChrisH
    ChrisH over 4 years
    This appears to be all sorts of broken with the latest IOS updates and/or Catalina updates and/or Flutter updates. I have no idea. Changing this now breaks the deployment as it renames the <appname>.app folder from a consistent Runner.app to whatever you put in display name, and then "flutter run" breaks. Now, if you want to change it, you name the name:<value> key in the YAML file, then do global search/replace on the package name. (sigh)
  • Dpedrinha
    Dpedrinha over 4 years
    If you change Display Name in the runner project it will stop working. It has to be ´Runner' Apparently, it is necessary to change the name and version data on the pubspeck.yaml file only, which is quite incovenient if android and ios apps have different versions or name localization
  • Dpedrinha
    Dpedrinha over 4 years
    Nice! I'll test the plugin. But as far as I know, if you change the Display Name on the info.plist file from 'Runner', the app stops compiling. It has to be 'Runner'.
  • Mi Be
    Mi Be over 4 years
    what helped me: go to "Info" Tab and change "Bundle name".
  • Mi Be
    Mi Be over 4 years
    Sorry it is not working. Like Dpedrinha said, it has to be 'Runner'.
  • Александр Бабич
    Александр Бабич over 4 years
    I wonder how you put display name in pubspec with all spaces, cyrillic letters, etc.
  • Dheeraj Avvari
    Dheeraj Avvari over 4 years
    @Johnykutty Were you able to figure out? Am also having the same issue
  • CopsOnRoad
    CopsOnRoad over 4 years
    @ChrisH I am running updated version of all, and it does work as expected.
  • Jorge Wander Santana Ureña
    Jorge Wander Santana Ureña over 4 years
    it's working for me. But i need to delete the app and reinstall it after run: flutter pub run flutter_launcher_name:main
  • pjotr_dolphin
    pjotr_dolphin over 4 years
    For iOS this is incorrect. One should change the CFBundleName in Info.plist. Flutter will not find the app, as it will look for the Runner.app, and if you change it in Xcode that is no longer the case.
  • Katu
    Katu over 4 years
    There is also a plugin to replace the icon pub.dev/packages/flutter_launcher_icons
  • Muhammad bin Yusrat
    Muhammad bin Yusrat about 4 years
    This answer is just wrong, at least for iOS. To change the name that is displayed under the Apps icon in iOS, I had to go to App Directory > ios > Runner, open info.plist and change the 'bundle name' from 'app' to whatever I would like to call it. That is the only thing which actually worked. Changing Runner in Runner.xcworkspace will not allow you to run the app after the next build.
  • Peter Mortensen
    Peter Mortensen over 3 years
    Should the backticks literally be there?
  • Peter Mortensen
    Peter Mortensen over 3 years
    Shouldn't the tag application be closed after android:label="test"? Or is all of "The rest of the code" (XML) attributes?
  • Braken Mohamed
    Braken Mohamed over 3 years
    yes it should be closed last after all the tags cuz it's the parent of all tags
  • Ride Sun
    Ride Sun over 3 years
    The plugin was not updated for flutter 2.0 and has dependency issues
  • Fethi
    Fethi about 3 years
    what about name in pubspec.yaml
  • CopsOnRoad
    CopsOnRoad about 3 years
    @Fethi That's just the name of your project. For names, you'll have to edit the AndroidManifest.xml file (in Android) and info.plist (in iOS). Flutter docs mention it too.
  • Sanal Kv
    Sanal Kv about 3 years
    how to add space between the app name, ios info.plist doesnt support space.
  • Joaquin Hoffmann
    Joaquin Hoffmann about 3 years
    I had the followin error that went away when I removed the flutter_launcher_name dependency: Flutter – Error: ADB exited with exit code 1
  • Isac Moura
    Isac Moura about 3 years
    There is a paliative solution for the problem with the plugin according to this comment
  • Max00355
    Max00355 about 3 years
    This plugin is no longer valid as it has not been upgraded to Flutter 2, so you will run into dependency issues. flutter_app_name (pub.dev/packages/flutter_app_name) is a nearly identical plugin but works with Flutter 2.0.
  • Haidar
    Haidar almost 3 years
    @CopsOnRoad is it a better practice to define the android app name inside strings.xml instead of hardcoding it?
  • CopsOnRoad
    CopsOnRoad almost 3 years
    @HaidarMehsen Yes, you should if you're targeting different locales.
  • Tarik Hacialiogullari
    Tarik Hacialiogullari over 2 years
    I found a plugin to change display name of both at one location: pub.dev/packages/flutter_launcher_name
  • bolino
    bolino about 2 years
    A more recent version of this module, compatible with Flutter 2 and with null safety, is pub.dev/packages/flutter_app_name
  • qix
    qix about 2 years
    Even newer than the published package is the repo itself: github.com/f-prime/flutter_app_name which includes changes to support setting the bundleId (iOS) / applicationId (android) thanks to PR1