How to change flutter project name and id

0 votes
Is it possible to change flutter project name and organisation ? I want to change only the project's name and organisation id without recreating the whole project with flutter create <project name> --organisation <organisation-id>
Mar 17, 2023 in Flutter by sarit
• 1,830 points
8,410 views

1 answer to this question.

0 votes

Yes, it is possible to change the project name and organization ID in an existing Flutter project without recreating the entire project. Here are the steps to follow:

  1. Rename the project folder: You can rename the project folder from the file explorer or terminal by using the mv command. For example, if the current project name is "old_project_name", you can rename it to "new_project_name" by executing the following command in the terminal:
mv old_project_name new_project_name
  1. Update the pubspec.yaml file: Open the pubspec.yaml file and update the name and organization fields with the new values. For example:
name: new_project_name description: A new Flutter project version: 1.0.0 # Update the organization field organization: com.new_organization_id
  1. Update the AndroidManifest.xml file: Open the AndroidManifest.xml file located in the android/app/src/main directory and update the package name with the new organization ID. For example:
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.new_organization_id.new_project_name">
  1. Update the MainActivity.java file: Open the MainActivity.java file located in the android/app/src/main/java/com/example/new_project_name directory and update the package name with the new organization ID. For example:
package com.new_organization_id.new_project_name;
  1. Update the AppDelegate.swift file: Open the AppDelegate.swift file located in the ios/Runner directory and update the bundle identifier with the new organization ID. For example:
Bundle.main.bundleIdentifier = "com.new_organization_id.new_project_name"

After following these steps, you should be able to run the project with the new name and organization ID.

To know more, join our Flutter App Development Course today.

answered Mar 20, 2023 by pooja