Repository navigation
Description
Steps to reproduce
AnalysisOptionsMigration (added in #187940, shipped in 3.47.0) decides whether a project needs migrating by reading only the literal contents of that project's own analysis_options.yaml. It never resolves include:, so a project that already inherits the exclusions from a shared analysis options file gets rewritten anyway, on every command that calls ensureReadyForPlatformSpecificTooling (flutter pub get, flutter analyze, flutter run, flutter build).
From a stock flutter create repro:
- Move the analyzer config into
repro/shared_options.yaml:include: package:flutter_lints/flutter.yaml analyzer: exclude: - build/** - android/** - ios/** - web/** - windows/** - macos/** - linux/**
- Reduce
repro/analysis_options.yamltoinclude: shared_options.yaml - Confirm the inherited exclusions really are in effect.
dart analyzedoesn't run the migration, so it sees the unmodified file:$ printf 'int probe() => "nope";\n' > android/probe.dart && dart analyze No issues found! $ printf 'int probe() => "nope";\n' > lib/probe.dart && dart analyze error - lib/probe.dart:1:16 - A value of type 'String' can't be returned ... - return_of_invalid_type
android/is excluded,lib/is still analyzed. The shared config works. flutter analyze
Expected results
No migration. The project already excludes every directory in excludesToExclude.
Actual results
$ flutter analyze
Upgrading analysis_options.yaml to exclude build and platform directories.The file is rewritten to re-add the seven exclusions locally, duplicating what the included file already provides. Reverting and re-running any Flutter command adds them straight back, so there's no way to keep the config centralized.
This hurts monorepos with a shared lints package. supabase/supabase-flutter publishes a supabase_lints package that all 20 workspace packages include; putting the exclusions there analyzes correctly, but flutter pub get still rewrites all 20 files, so a routine pub get leaves every contributor with a 20-file dirty working tree.
Suggested fix
analysis_options_migration.dart#L50-L65 inspects root['analyzer']['exclude'] directly after loadYamlNode. Resolving include: (relative paths and package: URIs) before computing needsMigration would make it a no-op whenever the effective options already carry the exclusions, whichever file in the chain declares them.
If full include resolution is too costly for a path that runs on every command, a narrower fix would be to skip the migration when the local file is only an include: directive, or to add an opt-out flag.
Flutter Doctor output
Doctor output
[✓] Flutter (Channel stable, 3.47.0, on macOS 26.6.1 25G76 darwin-arm64, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 36.1.0)
[!] Xcode - develop for iOS and macOS
✗ Xcode installation is incomplete; a full installation is necessary for iOS and macOS development.
! CocoaPods not installed.
[✓] Chrome - develop for the web
[✓] Connected device (2 available)
[✓] Network resources
Activity
chore: fix the analyzer issues from Flutter 3.47 (#1705)
rawi-coding commentedon Aug 13, 2026
We have the same problem when using Dart Workspaces. In a project structured like this, it makes no sense to add platform specific exclusions to all
analysis_options.yaml. It would be nice if at least theinclude:was respected as asked above or make this optional or opt-out.The exclusion is only needed in the
appworkspace.saurabh-mirajkar commentedon Aug 13, 2026
@spydon Thanks for the detailed report. I was able to reproduce this on Flutter 3.47.0. Labeling this and passing it on to tool team for further investigation.
fix: Adapt to Flutter 3.47 (#3995)
[flutter_tools] Resolve includes recursively in AnalysisOptionsMigrat…
💚 Adopt CI to Flutter 3.47 (#2592)
[stable] [flutter_tools] Resolve includes recursively in AnalysisOpti…
[beta] [flutter_tools] Resolve includes recursively in AnalysisOption…
fix: Adapt to Flutter 3.47 (#3995)
github-actions commentedon Aug 31, 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.