Repository: flutter
Issue: Flutter create bundle identifier should be the same across all platforms
Labels: tool,c: proposal,P2,team-tool,triaged-tool

### Steps to reproduce

1. `flutter create --org ch.2221 test_flutter_bundle_id`
2. Observe the different bundle ids being created

### Expected results

`flutter create` should throw an error, or at least warn of this behaviour. It should not, in my opinion, create different bundle ids. This has significantly impacted my app, and I cannot change it since this would mean delisting from the App Store and relisting.

### Actual results

The bundle ids are different:
- iOS: `ch.2221.testFlutterBundleId`
- macOS: `ch.2221.testFlutterBundleId`
- linux: `ch.u2221.test_flutter_bundle_id`
- Android: `ch.u2221.test_flutter_bundle_id`

[This is because iOS and macOS allows segments to start with a digit, but don't allow underscores.](https://github.com/flutter/flutter/blob/master/packages/flutter_tools/lib/src/commands/create_base.dart#L675)

[android does not allow segments to start with a digit but allow underscores.](https://github.com/flutter/flutter/blob/master/packages/flutter_tools/lib/src/commands/create_base.dart#L637)

Linux seems to use Android's bundle id.

### Code sample


No code sample, this is for the CLI.

### Screenshots or Video

<details open>
<summary>Screenshots / Video demonstration</summary>


https://github.com/user-attachments/assets/df3ca45e-a9ba-4970-9dc5-73083b785177

</details>


### Logs

<details open><summary>Logs</summary>

```console
manaf@Cooper.local:~/Developer $ flutter create --org ch.2221 test_flutter_bundle_id
Developer identity "Apple Development: Manaf Mhamdi Alaoui (0000000000)" selected for iOS code signing
Creating project test_flutter_bundle_id...
Resolving dependencies in `test_flutter_bundle_id`...
Downloading packages...
Got dependencies in `test_flutter_bundle_id`.
Wrote 129 files.

All done!
You can find general documentation for Flutter at: https://docs.flutter.dev/
Detailed API documentation is available at: https://api.flutter.dev/
If you prefer video documentation, consider: https://www.youtube.com/c/flutterdev

In order to run your application, type:

  $ cd test_flutter_bundle_id
  $ flutter run

Your application code is in test_flutter_bundle_id/lib/main.dart.

manaf@Cooper.local:~/Developer $ cd test_flutter_bundle_id/
manaf@Cooper.local:~/Developer/test_flutter_bundle_id $ grep -r 2221 ios
ios/Runner.xcodeproj/project.pbxproj:				PRODUCT_BUNDLE_IDENTIFIER = ch.2221.testFlutterBundleId;
ios/Runner.xcodeproj/project.pbxproj:				PRODUCT_BUNDLE_IDENTIFIER = ch.2221.testFlutterBundleId.RunnerTests;
ios/Runner.xcodeproj/project.pbxproj:				PRODUCT_BUNDLE_IDENTIFIER = ch.2221.testFlutterBundleId.RunnerTests;
ios/Runner.xcodeproj/project.pbxproj:				PRODUCT_BUNDLE_IDENTIFIER = ch.2221.testFlutterBundleId.RunnerTests;
ios/Runner.xcodeproj/project.pbxproj:				PRODUCT_BUNDLE_IDENTIFIER = ch.2221.testFlutterBundleId;
ios/Runner.xcodeproj/project.pbxproj:				PRODUCT_BUNDLE_IDENTIFIER = ch.2221.testFlutterBundleId;
manaf@Cooper.local:~/Developer/test_flutter_bundle_id $ grep -r 2221 macos
macos/Runner/Configs/AppInfo.xcconfig:PRODUCT_BUNDLE_IDENTIFIER = ch.2221.testFlutterBundleId
macos/Runner/Configs/AppInfo.xcconfig:PRODUCT_COPYRIGHT = Copyright © 2024 ch.2221. All rights reserved.
macos/Runner.xcodeproj/project.pbxproj:				PRODUCT_BUNDLE_IDENTIFIER = ch.2221.testFlutterBundleId.RunnerTests;
macos/Runner.xcodeproj/project.pbxproj:				PRODUCT_BUNDLE_IDENTIFIER = ch.2221.testFlutterBundleId.RunnerTests;
macos/Runner.xcodeproj/project.pbxproj:				PRODUCT_BUNDLE_IDENTIFIER = ch.2221.testFlutterBundleId.RunnerTests;
manaf@Cooper.local:~/Developer/test_flutter_bundle_id $ grep -r 2221 android
android/app/build.gradle:    namespace = "ch.u2221.test_flutter_bundle_id"
android/app/build.gradle:        applicationId = "ch.u2221.test_flutter_bundle_id"
android/app/src/main/kotlin/ch/u2221/test_flutter_bundle_id/MainActivity.kt:package ch.u2221.test_flutter_bundle_id
manaf@Cooper.local:~/Developer/test_flutter_bundle_id $ grep -r 2221 linux
linux/CMakeLists.txt:set(APPLICATION_ID "ch.u2221.test_flutter_bundle_id")
```

</details>


### Flutter Doctor output

<details open><summary>Doctor output</summary>

Redacted some irrelevant stuff for privacy.

```console
[!] Flutter (Channel stable, 3.22.0, on macOS 14.6 23G80 darwin-arm64, locale fr-CH)
    • Flutter version 3.22.0 on channel stable at /Users/manaf/flutter-install-directory
    ! Warning: `dart` on your path resolves to /opt/homebrew/Cellar/dart/3.4.4/libexec/bin/dart, which is not inside your current Flutter
      SDK checkout at /Users/manaf/flutter-install-directory. Consider adding /Users/manaf/flutter-install-directory/bin to the front of
      your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 5dcb86f68f (3 months ago), 2024-05-09 07:39:20 -0500
    • Engine revision f6344b75dc
    • Dart version 3.4.0
    • DevTools version 2.34.3
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update
      checks and upgrades.

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/manaf/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15F31d
    • CocoaPods version 1.15.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2023.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)

[✓] VS Code (version 1.92.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.94.0

[✓] Connected device (5 available)
    • srx (mobile)                    • 00000000-0000000000000000 • ios            • iOS 17.4.1 21E236
    • Blåhaj (mobile)                 • 00000000-0000000000000000 • ios            • iOS 18.1 22B5007p
    • macOS (desktop)                 • macos                     • darwin-arm64   • macOS 14.6 23G80 darwin-arm64
    • Mac Designed for iPad (desktop) • mac-designed-for-ipad     • darwin         • macOS 14.6 23G80 darwin-arm64
    • Chrome (web)                    • chrome                    • web-javascript • Google Chrome 127.0.6533.100
    ! Error: Browsing on the local area network for La ne-zo est quadrillee. Ensure the device is unlocked and attached with a cable or
      associated with the same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)
    ! Error: Browsing on the local area network for Mogis. Ensure the device is unlocked and attached with a cable or associated with the
      same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 1 category.
```

</details>