How to change package name in Flutter

October 09, 2022 No comments flutter dart flutter-packages

Introduction

In Flutter, we may wish to change the package name. In this post, we'll look at how to do it.

How to change package name in a flutter

To change the Package Name of a Flutter project:

  • for Android App Name we need to change android:label attribute in AndroidManifest.xml file:

    <application
      android:name="io.flutter.app.FlutterApplication"
      android:label="ThisIsTheNameOfYourApplication"   
    >
    
  • for package name chnange in AndroidManifest.xml:

    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="your.package.name">
    

and in build.gradle file:

defaultConfig {
    applicationId "your.package.name"
    minSdkVersion 16
    targetSdkVersion 27
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

Conclusion

In this post, we presented the best way to change the package name in a flutter.

{{ message }}

{{ 'Comments are closed.' | trans }}