Repository navigation
Description
Disclaimer
The issue was researched and published by AI
Steps to reproduce
flutter create --platforms=android myapp
cd myapp
grep 'platform:' .metadata # shows: root, android
flutter create --platforms=ios .
grep 'platform:' .metadata # shows: root, ios <-- android is goneExpected result
migration.platforms in .metadata lists root, android, ios — the requested
platform is added to the ones already tracked.
Actual result
The android entry is replaced by ios; the list still has only root + one platform:
migration:
platforms:
- platform: root
...
- - platform: android
+ - platform: ios
...The android/ directory still exists on disk — only its migration tracking is lost, so
flutter migrate no longer knows Android's create_revision / base_revision. .metadata
is marked "should not be manually edited", so there is no supported way to restore it.
Cause (not intentional)
In create_base.dart, .metadata is rebuilt from a fresh empty MigrateConfig() populated
only with the platforms passed to the current --platforms invocation. The existing
.metadata is never read, so any previously tracked platform not repeated in this run is
dropped.
Environment
Flutter 3.32.5 • channel stable • Framework fcf2c11572 (2025-06-24) • Dart 3.8.1
macOS (darwin), project_type: app
Activity
saurabh-mirajkar commentedon Aug 24, 2026
@ChaserVasya Thanks for the report. I can reproduce this on the latest stable Flutter release (3.47.1). Running
flutter create --platforms=<platform>on an existing project rewrites themigration.platformssection in.metadata, replacing previously tracked platforms instead of preserving them. Labelling and routing for further investigation.Shawn-Yu-Dev commentedon Aug 24, 2026
I've successfully reproduced this issue as well. I suspect the root cause lies within packages/flutter_tools/lib/src/commands/create.dart.
I will look into it and try to submit a fix.
Shawn-Yu-Dev commentedon Aug 24, 2026
Hi! I'm currently working on a fix for this issue and plan to submit a PR soon.
fix: stop `flutter create --platforms` from dropping existing platfor…
fix: stop `flutter create --platforms` from dropping existing platfor…
fix: stop `flutter create --platforms` from dropping existing platfor…
fix: stop `flutter create --platforms` from dropping existing platfor…
fix: stop `flutter create --platforms` from dropping existing platfor… (
github-actions commentedon Sep 23, 2026
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.