'i get "Error running 'main.dart': Entrypoint isn't within a Flutter pub root" every time i try to run my app
i'm working on app using flutter and android studio this is the error I get every time i try to run my app i tired running other projects and they ran completely fine
Solution 1:[1]
This could be due to a failed rebuild.
- Click on
Fileat the top left corner on the menu bar. - Click
Project Structure - Click on
Moduleat the left end, then click onsources. - You will then see your project directory below the language level. Ensure that this path is correct and points to the root folder of your project. That is the project folder. If not update it and click
Okat the bottom of the dialog. - On the menu bar click on
Buildthenrebuild project.
Solution 2:[2]
I have encountered this issue recently and I don't know how or why but I somehow my main.dart file was no longer listed as a dart file - I Resolved this by right clicking the main.dart file in Android Studio. Clicked the menu option that populates 'Mark as Dart' afterwards no issues - it compiled and a lot less hair for me.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | |
| Solution 2 | Wiley |
