change_app_package_name

v1.5.0

Change App Package Name with single command. Update AndroidManifest, build.gradle, MainActivity files & move MainActivity file to new directory structure automatically.

Package archive: https://pubdev.letsnova.ru/api/archives/change_app_package_name/1.5.0.tar.gz

Installdart pub add change_app_package_name

Readme

Change App Package Name for Flutter

Change App Package Name with single command. It makes the process very easy and fast.

What It does?

  • Update AndroidManifest.xml files for release, debug & profile
  • Update build.gradle file
  • Update MainActivity file. Both java & kotlin supported.
  • Move MainActivity file to new package directory structure
  • Delete old package name directory structure.
  • Update Product Bundle Identifier in iOS.
    • if you have customized CFBundleIdentifier in Info.plist, it will not be updated. You have to update it manually.
  • Specify which platform they want to rename the package for.

How to Use?

Add Change App Package Name to your pubspec.yaml in dev_dependencies: section.

dev_dependencies: 
                  change_app_package_name: ^1.4.0
                

or run this command

flutter pub add -d change_app_package_name
                

Not migrated to null safety yet? use old version like this

dev_dependencies: 
                  change_app_package_name: ^1.4.0
                

Update dependencies

flutter pub get
                

Run this command to change the package name for both platforms.

dart run change_app_package_name:main com.new.package.name
                

To rename only Android:

dart run change_app_package_name:main com.new.package.name --android
                

To rename only IOS:

dart run change_app_package_name:main com.new.package.name --ios
                

Where com.new.package.name is the new package name that you want for your app. replace it with any name you want.

Meta

Atiq Samtia– @AtiqSamtiame@atiqsamtia.com

Distributed under the MIT license.

https://github.com/atiqsamtia/change_app_package_name

Contributing

  1. Fork it (https://github.com/atiqsamtia/change_app_package_name/fork)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

Changelog

[1.5.0] - (February 23, 2025)

  • Add support for Flutter 3.29.0 for Android build.gradle.kts file structure.

[1.4.0] - (September 20, 2024)

  • Specify which platform they want to rename the package for. Thanks @moha-b #43

[1.3.0] - (July 08, 2024)

  • iOS support added

[1.2.0] - (Jun 03, 2024)

  • Support Flutter 3.22.0
  • Fix regex to only replace package name in manifest files
  • Fix #26 where kotlin directory does not exist so it should not throw error.
  • add extra check to make sure the old application id is found before proceeding to next steps.

[1.1.0] - (April 08, 2021)

  • Change MainActivity mechanism to handle different locations.

[1.0.0] - (April 08, 2021)

  • Added null safety.

[0.1.3] - (April 08, 2021)

  • Add extra Files checks. Hopefully fixes #7

[0.1.2] - (March 16, 2020)

  • Bug Fix in README.md

[0.1.1] - (March 16, 2020)

  • Update code as per pub.dev guidelines

[0.1.0] - (March 16, 2020)

  • Change Android Package Name with single command