Change Flutter Package Name
The easiest and most reliable method to change your Flutter project's package name (also known as the application ID or bundle ID) is by using a dedicated package, such as the change_app_package_name or rename package.
The old way of running the package (flutter pub run) is deprecated — Flutter now uses dart run instead.
Also, the package needs to be added as a dev_dependency first.
Correct Way to Change Package Name (2026 Updated Method)
Step 1: Add the package to your project
Run this command:
Bash
flutter pub add --dev change_app_package_name
Step 2: Run the rename command using dart run
dart run change_app_package_name:main xx.xxx.xxx
This will:
- Change applicationId in Android build.gradle
- Update AndroidManifest.xml
- Move and update Kotlin/Java files
- Handle iOS bundle identifier (if iOS project exists)
Step 3: Clean and rebuild
flutter clean flutter pub get flutter run
Method 2: Manual Renaming (Advanced)
If you prefer not to use a package or need more granular control, you can manually update the relevant files. Android:
- Update the
applicationIdinandroid/app/build.gradlewithin thedefaultConfigsection. - Update the
namespaceinandroid/app/build.gradle(orpackageattribute inAndroidManifest.xmlin older projects). - Manually refactor the directory structure in
android/app/src/main/kotlinorandroid/app/src/main/javato match the new package name. - Perform a global search and replace (Ctrl+Shift+F or Cmd+Shift+F) for the old package name across the entire project to catch all occurrences, including
AndroidManifest.xmlfiles indebugandprofilefolders.
- Update the
- iOS:
- Open the iOS module in Xcode by right-clicking the
iosfolder and selectingOpen in Xcode. - In the project navigator, select the
Runnerproject, then theRunnertarget, and go to the General tab. - Update the Bundle Identifier field to your new package name.
- Alternatively, edit the
ios/Runner/Info.plistfile and change theCFBundleIdentifierkey value. After making manual changes, always runflutter cleanand thenflutter runto rebuild the project with the new configurations. If using Firebase, remember to update the package name in your Firebase console settings as well.
- Open the iOS module in Xcode by right-clicking the


Post a Comment
0Comments