10

I just made a Flutter app following the instructions of this page, and I googled how to change the name of the application, and found this answer. But I can't change the name of the application from the manifest file. Initially android:name is io.flutter.app.FlutterApplication. I changed that to Startup Namer, and it gave the error

error: attribute 'android:name' in <application> tag must be a valid Java class name.

How to reslove this error and change the name?

Aman Vangani
  • 175
  • 1
  • 1
  • 9
  • Have you tried without the space between `Startup` and `Namer`? – Günter Zöchbauer Sep 23 '18 at 14:34
  • 2
    I tried it now, it still gave the same error. However, I saw another parameter `android:label` and changed it to `Startup Namer`, and it worked. – Aman Vangani Sep 23 '18 at 15:18
  • Possible duplicate of [How to change the app display name build with flutter?](https://stackoverflow.com/questions/49353199/how-to-change-the-app-display-name-build-with-flutter) – Achyut Mar 21 '19 at 10:44

2 Answers2

9

The displayed name of the application is identified by the attribute android:label. You should change that one instead of android:name.

Jonathan
  • 352
  • 2
  • 9
9

Edit AndroidManifest.xml for Android and info.plist for iOS

For Android, edit only android:label value in the application tag in file AndroidManifest.xml located in the folder: android/app/src/main

Code:

<manifest xmlns:android="http://schemas.android.com/apk/res/android">
    <application
        android:name="io.flutter.app.FlutterApplication"
        android:label="Your Application Name"  //here
        android:icon="@mipmap/ic_launcher">
        <activity>
        <!--  -->
        </activity>
    </application>
</manifest>

For iOS, edit only the value inside the String tag in file Info.plist located in the folder ios/Runner .

Code:

<plist version="1.0">
<dict>
    <key>CFBundleName</key>
    <string>Your Application Name </string>  //here
</dict>
</plist>

Do a flutter clean and restart your application if you have a problem.

Kab Agouda
  • 6,309
  • 38
  • 32