Skip to content

Error running 'main.dart': Entrypoint isn't within a Flutter pub root #9043

Description

@ThHareau

Hi,

I cannot run flutter from intellij because of the following error:

Error running 'main.dart':
Entrypoint isn't within a Flutter pub root

Flutter doctor:

[✓] Flutter (Channel stable, 3.44.6, on Fedora Linux 44 (Workstation Edition) 7.0.14-201.fc44.x86_64, locale fr_FR.UTF-8) [43ms]
    • Flutter version 3.44.6 on channel stable at 
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ee80f08bbf (il y a 12 jours), 2026-07-08 15:02:06 -0700
    • Engine revision 83675ed276
    • Dart version 3.12.2
    • DevTools version 2.57.0
    • Feature flags: enable-web, no-enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-native-assets, enable-swift-package-manager,
      omit-legacy-version-file, enable-lldb-debugging, enable-uiscene-migration

[✓] Android toolchain - develop for Android devices (Android SDK version 36.1.0) [7,3s]
    • Android SDK at
    • Emulator version 36.6.11.0 (build_id 15507667) (CL:N/A)
    • Platform android-36, build-tools 36.1.0
    • Java binary at: /usr/bin/java
      This JDK was found in the system PATH.
      To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version OpenJDK Runtime Environment Temurin-21.0.11+10 (build 21.0.11+10-LTS)
    • All Android licenses accepted.

[✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome) [9ms]
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[✓] Connected device (1 available) [134ms]
    • Pixel 8 (mobile) 

[✓] Network resources [210ms]
    • All expected network resources are available.

! Doctor found issues in 1 category.

Dart plugin version is 507.0.0
Flutter plugin version is 94.0.0
IntelliJ version is IntelliJ IDEA 2026.2

Workaround

Found in #4692 (comment) : delete lib/.dart_tool folder

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions