Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Flutter and app store releases

analysis_options.yaml: the URI it includes can't be found

ErrorThe URI 'package:flutter_lints/flutter.yaml' included in '/path/analysis_options.yaml' can't be found when analyzing '/path'.

Short answer

The analyzer reports include_file_not_found when the file named after include: in analysis_options.yaml does not resolve. For a package: include, the package must be a dev dependency and be downloaded. Add it with flutter pub add dev:flutter_lints, run pub get, and use the exact include line from the package page.

  • Applies to Flutter 3.3x stable, Dart 3.x
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Print the include line and look for the package in the project files.

    grep -n 'include' analysis_options.yaml
    grep -n lints pubspec.yaml pubspec.lock
  2. 2Match what you see, then jump to its fix

    1. 1grep finds nothing for the package named in the include lineThe lint package is not a dependency yet, or pub get was not runFix
    2. 2The package is listed in pubspec.lock but the message still names the fileThe include line names a file the package does not haveFix

What does the error look like?

  • The URI 'package:flutter_lints/flutter.yaml' included in '/path/analysis_options.yaml' can't be found when analyzing '/path'.
  • include_file_not_found

Cause 1 of 2

The lint package is not a dependency yet, or pub get was not run

1Check

A package: URI can only be resolved when the package is in the project's dependencies and has been fetched. The Dart analysis docs tell you to add the lints package as a dev dependency before including its rule set. Older projects often have the include line but no matching entry in dev_dependencies.

grep -n -A6 'dev_dependencies' pubspec.yaml

2Fix

Add the package as a dev dependency, which also runs pub get.

flutter pub add dev:flutter_lints

3Verify

Restart the analysis server in your editor, or analyze from the terminal.

flutter analyze

Confirmed by pub.dev

Did this fix it?

Cause 2 of 2

The include line names a file the package does not have

1Check

Each package documents its own file names. flutter_lints is included as package:flutter_lints/flutter.yaml, and the plain lints package offers core and recommended rule sets. Copying a line from a tutorial for the other package leaves a path that does not exist.

grep -n 'include' analysis_options.yaml

2Fix

Replace the include line with the one printed on the package's own page. Include several files as a list if you want to.

# analysis_options.yaml
include: package:flutter_lints/flutter.yaml

# or, with the lints package
# include: package:lints/recommended.yaml

3Verify

Analyze again. The warning on the first line of the file disappears.

flutter analyze

Confirmed by dart.dev

Did this fix it?

How do I stop it coming back?

  • Add the lint package and the include line in the same commit.
  • Run flutter pub get after cloning a project and after switching branches.
  • When you copy an analysis_options.yaml from another repo, copy its dev_dependencies too.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.