Change Android PackageName
To change the package name (also known as the applicationId) of a Flutter project for the Android platform, you need to follow these steps:
Update AndroidManifest.xml:
Open the android/app/src/main/AndroidManifest.xml file. Change the package attribute of the element to your new package name (com.yourdomain.yourname in your case).
To change the App display name below app icon you need to change the field android:label
as shown below
Update build.gradle:
Open the android/app/build.gradle file. Change the namespace & applicationId to your new package name.
Rename Package Directory:
Rename the existing com/example/test directory to com/yourdomain/yourname in the android/app/src/main/kotlin/ directory.
Change package name in MainActivity.kt:
Change the package name to com.yourdomain.yourname in MainActivity.kt file located in the android/app/src/main/kotlin/com/yourdomain/yourname directory.
Run flutter clean and Rebuild:
Run flutter clean in the terminal to clear any previous build artifacts. Rebuild your project by running flutter build.
Last updated