Sub topic 3
Setting the Application ID, Bundle Identifier, and App Name
This chapter assumes that you know basic Dart and Flutter development and can use the flutter command-line tool. You should also have a Flutter project and understand that Android and iOS keep some settings in their platform folders.
A Flutter app has one Dart codebase, but each operating system identifies the app separately. Android uses an application ID. iOS uses a bundle identifier. The app also has a display name, which is the human-readable name shown on the device.
Application identity
The application ID is the unique identifier Android uses for an installed app. It usually follows reverse-domain notation, such as com.example.weather. Google Play uses this value to connect uploads to the same app. Changing it later can create a different app instead of updating the existing one.
The bundle identifier has the same purpose on iOS. A value such as com.example.weather identifies the app in Xcode, App Store Connect, and the device. Apple provisioning profiles and signing certificates are linked to this identifier.
Choose stable identifiers before releasing publicly. Use a domain or organization name that you control when possible.
| Setting | Platform | Example | Main purpose |
|---|---|---|---|
| Application ID | Android | `com.acme.weather` | Identifies the Android package |
| Bundle identifier | iOS | `com.acme.weather` | Identifies the iOS bundle |
| Display name | Android and iOS | `Acme Weather` | Name users see on the device |
Files and settings to edit
Flutter stores native project settings in the android and ios directories. The Dart files under lib do not normally define the platform identity.
For Android, open android/app/build.gradle or android/app/build.gradle.kts. Find the applicationId inside defaultConfig and replace the generated value:
android {
namespace "com.acme.weather"
defaultConfig {
applicationId "com.acme.weather"
minSdkVersion flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion
}
}Some projects use Gradle Kotlin DSL instead:
android {
namespace = "com.acme.weather"
defaultConfig {
applicationId = "com.acme.weather"
}
}The namespace controls where generated Android classes belong. The applicationId identifies the installed app. They are often equal, but they are separate settings.
Set the Android display name in the application manifest or in the value referenced by its android:label attribute. For a simple project, the relevant part can look like this:
<application
android:label="Acme Weather"
android:icon="@mipmap/ic_launcher">
</application>Do not remove other attributes from your existing manifest. Edit only the label unless you know that another setting must change.
For iOS, open the ios folder in Xcode by opening ios/Runner.xcworkspace, not only Runner.xcodeproj. Select the Runner target, open Signing & Capabilities, and set Bundle Identifier to com.acme.weather. In the target's General settings, set Display Name to Acme Weather.
You can also inspect these values in the Xcode project settings. Xcode may store the bundle identifier as PRODUCT_BUNDLE_IDENTIFIER. Use Xcode for signing-related changes because it keeps the target and provisioning settings consistent.
Verify the identity
Run the app on an Android emulator or device and an iOS simulator or device. Check the name under the launcher icon and in the installed-app settings. You can also build each platform and inspect the generated artifact before uploading it.
Common errors
- Changing only
namespaceand forgettingapplicationId. - Using different identifiers accidentally for Android and iOS when the team expects one shared naming scheme.
- Editing the wrong Xcode target.
- Opening
Runner.xcodeprojinstead ofRunner.xcworkspacewhen CocoaPods is enabled. - Changing the display name but expecting it to change the store listing name. Store listings have separate metadata.
- Using an identifier that belongs to another app or organization.
Exercise
You renamed the display name from Example to Acme Weather, but the app still installs as a separate app after changing com.example.app to com.acme.weather. Why?
Show answer
The application ID identifies the Android app. Changing it creates a different package, while the display name only changes the label users see.