First Time Configuration
Update Package ID & Bundle ID

Changing Bundle ID and Package Name in Flutter

Android

  1. Open the Flutter project in Android Studio or your preferred text editor.

  2. Navigate to the android/app directory.

  3. Open the build.gradle file.

  4. Locate the defaultConfig block.

  5. Change the applicationId value to your desired package name.

  6. Save the file.



  7. Navigate to the android/app/src/main directory.

  8. Open the AndroidManifest.xml file.

  9. Update the package attribute in the manifest tag with your desired package name.

  10. Save the file.



Kotlin Package Import and Folder Structure

  • In Android, the package import and folder structure are determined by the package name specified in the build.gradle file.

  • The Kotlin package import and folder structure will match the package name you set in the build.gradle file.

  • For example, if your desired package name is com.example.myapp, the Kotlin package import and folder structure will be as follows:

    • Package Import: import com.example.myapp.*

    • Folder Structure: app/src/main/kotlin/com/example/myapp



iOS

  1. Open the Flutter project in Xcode or your preferred text editor.

  2. Navigate to the ios/Runner directory.

  3. Open the Info.plist file.

  4. Locate the CFBundleIdentifier key.

  5. Change the value of the CFBundleIdentifier key to your desired bundle ID.

  6. Save the file.





Updating Flutter Code

  1. Open the Flutter project in your preferred text editor.

  2. Open the pubspec.yaml file.

  3. Locate the name field.

  4. Update the value of the name field to your desired package name.

  5. Save the file.



Clean and Rebuild

  1. In the terminal or command prompt, navigate to the root directory of your Flutter project.

  2. Run the command flutter clean to clean the project.

  3. Run the command flutter build to rebuild the project with the updated bundle ID and package name.

  4. Once the build process is complete, you can run your app on Android and iOS devices with the new bundle ID and package name.