Skip links

How to change the package name?

How to change the package name?

This is very important. Your app cannot have the same package name as other app. If it   does, the  playstore will not accept it as a unique application. So rename your app according to your business/brand name.Try to write  a unique package name.

Naming convention: https://docs.oracle.com/javase/tutorial/java/package/namingpkgs.html

 

For example

Let’s say your package is: com.onatcipli.networkUpp

And your app name is “Network Upp”

Then,

Run this command inside your flutter project root.
Run the command in android studio terminal:

flutter pub run rename –bundleId com.onatcipli.networkUpp

flutter  pub run rename –appname “Network Upp” 

 

Try uninstalling the app from the emulator , then run the commands and then restart the app.

If it does not work, first uninstall, then restart the app then run the commands.

**In case the above do not work:

 

In Android

for package name just change in build build.gradle only (android/app/build.gradle)

defaultConfig {

    applicationId “com.onatcipli.networkUpp

   ………….

}

 

**However in one place you must have to manually change your package name.
Open android/app/google-services.json , and change your package name manually. Otherwise you will get a build error , even on emulator on debug build

For iOS:

Change the bundle identifier from your Info.plist file inside your ios/Runner directory.

<key>CFBundleIdentifier</key>

<string>com.onatcipli.networkUpp</string>

If you face issues consult a flutter developer.