'How to rename app package in flutter project?
I want to rename my app package.
I can't upload my app on play store because my app package is com.example.example. How can I change it easily?
Solution 1:[1]
For Android
Goto, app level
build.gradleand specify your unique applicationID
defaultConfig {
applicationId "your-package-name"
minSdkVersion 16
targetSdkVersion 27
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
For IOS
Goto,
Info.plistinsideios/Runnerdirectory and change the bundler identifier
<key>CFBundleIdentifier</key>
<string>com.your.packagename</string>
Solution 2:[2]
This is a quick way of getting it done using project level find and replace. Click CTRL + SHift + R Then type the name of the old package name com.old.package_name, this will show you everywhere the old package name is used in the project. Then type the name of the new package name you want to replace it with in the lower tab: com.new.package_name then click replace all. This worked for me.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Community |
| Solution 2 | Igbokwenu |
