← Back to list

Change Package Name In Flutter

Sometime We got stuck in the situation where we have to change package name of the the flutter projects and we kept on searching for how to…

Lakshydeep Vikram in Go With Flutter · 2021-06-28 05:19 · 0 claps · 1.5 min read paywalled
#change-package-name #flutter #package-name #change
Open on Medium ↗
Wiki topics: 📱 · Mobile Development

Change Package Name In Flutter

Sometime We got stuck in the situation where we have to change package name of the the flutter projects and we kept on searching for how to change package name of already created flutter projects.

If you are creating new flutter project and want to put package name of your choice then do like this and you’ll have the flutter project of your own desired package name.

  • Open cmd terminal or vscode terminal
  • Go to the location where you want to create flutter projects
  • Suppose your project name is demo ,and want your package name as “com.demo.demo” then type the code like this:
 flutter create --org com.demo demo
//flutter create --org com.<package_name> <app_name>

If you had already created projects,and want to change package name then do the following procedure:

  1. Install package: change_app_package_name in pubspec.yaml file under dev_dependencies section.
dev_dependencies: 
change_app_package_name: ^1.0.0

2.Open terminal and run the following code: flutter pub run change_app_package_name:main com.new.**package**.name

After doing mentioned above steps, your project will shift to new package name. What actually that packages does have been explained below:

  1. Go to android\app\src\main\AndroidManifest.xml ,replace the old package name with new package name
  2. Go to android\app\src\profile\AndroidManifest.xml, replace the old package name with new package name
  3. Go to android\app\src\debug\AndroidManifest.xml ,replace the old package name with new package name
  4. Go to android\app\src\main\kotlin\…\…\…\MainActivity.kt, replace the old package name with new package name
  5. Go to android\app\build.gradle, replace the old package name with new package name
  6. Go to android\app\src\main\kotlin\…\…...\Application.kt, replace the old package name with new package name
  7. Rename the folder kotlin\com\<old package name>\<old app name>** under android\app\src\main\kotlin\ with kotlin\com\<new package name>\<new app name>**

Point 6 explanation: Suppose your old package name is “com.old.old_app” and new package name is “com.new.new_app” all you have to do is:

According to old package name your kotlin folder looks like:  android\app\src\main\kotlin\com\old\old_app\ 
According to new package name your kotlin folder will look like:
android\app\src\main\kotlin\com\new\new_app\

Give response if this article help you and follow me.

For more info buy the book “Make Yourself The Software Developer: Let’s Dive into Flutter & MNCs” buy. Keep coding and Keep Learning Thanks


메타데이터
post_id
8ec9fdbd0281
slug
change-package-name-of-flutter-projects-8ec9fdbd0281
url
https://medium.com/go-with-flutter/change-package-name-of-flutter-projects-8ec9fdbd0281
canonical_url
https://medium.com/go-with-flutter/change-package-name-of-flutter-projects-8ec9fdbd0281
author_url
https://medium.com/@lakshydeep-14
status
ok
fetched_at
2026-07-20 18:44:07