Skip to content

project-dir defaults to 'mobile' — silently wrong for a root-level app #34

Description

@stephane-segning

Summary

Every CLI command's --project-dir option defaults to 'mobile':

$ grep -rn "project-dir" bin/flutter_tools.dart | grep "defaultsTo: 'mobile'"
bin/flutter_tools.dart:67:      ..addOption('project-dir', defaultsTo: 'mobile')
bin/flutter_tools.dart:144:      ..addOption('project-dir', defaultsTo: 'mobile')
bin/flutter_tools.dart:299:      ..addOption('project-dir', defaultsTo: 'mobile', help: 'Flutter app dir.')
bin/flutter_tools.dart:382:      ..addOption('project-dir', defaultsTo: 'mobile')
bin/flutter_tools.dart:542:      ..addOption('project-dir', defaultsTo: 'mobile')
bin/flutter_tools.dart:596:      ..addOption('project-dir', defaultsTo: 'mobile')
bin/flutter_tools.dart:856:      ..addOption('project-dir', defaultsTo: 'mobile')
bin/flutter_tools.dart:946:      ..addOption('project-dir', defaultsTo: 'mobile')

For a root-level Flutter app (the app is the repo root, not a mobile/ subdirectory —
the common case for a standalone consumer of this tool), the silent default points the
command at a directory that doesn't exist, producing a confusing downstream error instead
of a clear "you probably meant --project-dir ." message. This was already hit for real by
vaam-store/mobile (fixed locally there via
vaam-store/mobile#20-equivalent — fix(ci): pass project-dir '.' to android-setup/build actions — a workaround in the consumer, not a fix here).

Recommendation on record

Default to '.' (the common case for a standalone app), or fail loudly with a clear error
naming the missing directory and suggesting --project-dir explicitly, rather than
defaulting to a directory name ('mobile') that only made sense for this tool's own
original consumer.

Scope

  • Change the default across all 8 call sites (or introduce a single shared option
    builder so this can't drift again — 8 independent literals is itself a smell).
  • Decide '.' vs. fail-loudly (both fix the silent-wrong-path problem; pick one).
  • Update docs/RELEASING.md/README.md examples if they assume the old default.

Source of truth

grep -rn "project-dir" bin/flutter_tools.dart output above, 2026-08-18; the actual
downstream breakage this caused, vaam-store/mobile's own CI history (fix commit
"fix(ci): pass project-dir '.' to android-setup/build actions", 2026-08-18).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions