flutter / flutter/flutter-intellij

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

Open
#9,043 0 comments 1 reaction 0 assignees View on GitHub
dependency: flutter-tools P2
Dominant language
Java
Stars
2k
Forks
356
Avg merge
1d 11h
Merged PRs (30d)
27

Description

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 https://github.com/flutter/flutter-intellij/issues/4692#issuecomment-4660820365 : delete `lib/.dart_tool` folder

Contributor guide

Open the contributing guide

Research direction

Reproduce the IntelliJ run of main.dart using the reported Flutter, Dart, and plugin versions, then compare the project state before and after deleting lib/.dart_tool. Trace how the plugin handles that directory and project-root detection; done means the entrypoint runs without requiring that workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter, java
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.