Change App Package Name for Flutter with Ease

Published on by Flutter News Hub

Change App Package Name for Flutter with Ease

As a developer, you may occasionally need to update your Android app's package name. This can be a time-consuming and complex process, involving manual updates to multiple files.

However, with "Change App Package Name," a Flutter package, you can streamline this process with just a single command.

What It Does

  • Updates AndroidManifest.xml files for release, debug, and profile builds
  • Modifies build.gradle file
  • Refactors MainActivity file, supporting both Java and Kotlin versions
  • Moves MainActivity file to the new package directory
  • Removes old package directory

How to Use

  1. Add the package to your pubspec.yaml file:
dev_dependencies:
  change_app_package_name: ^1.1.0
  1. Run this command to change the package name:
flutter pub run change_app_package_name:main com.new.package.name

Replace com.new.package.name with your desired package name.

Example

Before:


  

After:


  

Meta Information

Contributing

Contributions are welcome! To contribute:

  1. Fork the repository
  2. Create a feature branch
  3. Implement your changes
  4. Create a pull request

Conclusion

"Change App Package Name" significantly simplifies the process of updating your app's package name, saving you time and effort.

Flutter News Hub