DEV Community

Cover image for How to change package name in flutter? fluttercorner.com
FlutterCorner
FlutterCorner

Posted on

How to change package name in flutter? fluttercorner.com

Hello Guys. Many times we need to change the package name of our project in flutter. So in this tutorial, we are going to learn How to change package name in flutter?

It is totally different method to change package names in android and iOS as well. So here is two methods for android and iOS. Here is defined all steps please followed meticulously to prevent any potential crash.

How to Change Package name in flutter for Android Project

How to Change Package name in flutter for Android Project

There are 4 steps to change the Package Name of your Flutter app in android. so follow every one step carefully.

Change the package name in your main AndroidManifest.xml file

Modify the file as the following path:

<Proect-Path>/android/app/src/main/AndroidManifest.xml
Enter fullscreen mode Exit fullscreen mode

Replace “com.example.flutter_app_test” with your new package name

Change the package name in your debug AndroidManifest.xml file

Do Same Here as We did in step 2.

<Proect-Path>/android/app/src/debug/AndroidManifest.xml
Enter fullscreen mode Exit fullscreen mode

Replace “com.example.flutter_app_test” with your new package name

Change the package name in your profile AndroidManifest.xml file

Do Same Here as We did in step 3 but with different paths.

<Proect-Path>/android/app/src/profile/AndroidManifest.xml
Enter fullscreen mode Exit fullscreen mode

Replace “com.example.flutter_app_test” with your new package name

Change the applicationId in your build.gradle file

Then all we need to do is change applicationId in build.gradle file.

<Proect-Path>/android/app/src/build.gradle
Enter fullscreen mode Exit fullscreen mode

Replace “com.example.flutter_app_test” with your new package name in applicationId as shown in the above image.

Run Flutter Clean

And this is our final step to reflect all changes. It’s recommended to run flutter clean after making changes.

How to Change Package name in flutter for Android Project
To change package name in a flutter. just change the package name in all the following files.

  1. /android/app/src/main/AndroidManifest.xml
  2. /android/app/src/debug/AndroidManifest.xml
  3. /android/app/src/profile/AndroidManifest.xml
  4. /android/app/src/build.gradle

So Guys That’s It For change package name in flutter tutorial. Hope you like our tutorial. Comment below Your thoughts and your queries. And Also Comment on your suggestion here.

Here Is Full Article With Images How to change package name in flutter?

Top comments (0)