How to change package name in flutter?

How to change package name in flutter?

We will start by changing the Android App Name first:

  • Open this file ‘AndroidManifest.xml‘ in your project and enter required name in front of ‘android:label’:
<application android:name="io.flutter.app.FlutterApplication"
     android:label=“EnterAppNameHere” 

Now we change the Package Name:

  • In the same file ‘AndroidManifest.xml‘  inside below mentioned line enter package name after ‘package=’:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"  
     package="your.package.name" 

                                                                           

  • Now in ‘build.gradle‘ file enter package name after ‘applicationId‘:
defaultConfig { applicationId "your.package.name"
         }
  • Open this file now ‘MainActivity.java’ and on top you will find ‘package’ where you can enter package name as below:
             package your.package.name;
             import android.os.Bundle;
             import io.flutter.app.FlutterActivity;
  • Last Step is to change the Directory name under Android Folder:

          Before  

android\app\src\main\java\com\example\name

\com   –> \your

\example  –> \package

          After change

android\app\src\main\java\your\package\name

 

* The Content stated above is for informational purpose only. Expert Software Team is not responsible if any part of content found meaningless in any manner or condition.

Leave a Reply

Your email address will not be published. Required fields are marked *