Reputation: 91
Flutter app runs on VS Code with Start Debugging & Run Without Debugging and also with terminal command "flutter run" . However it runs on Android Stuido only with terminal command "flutter run".
When I try to run it on Android Studio, with the play button which triggers the build, I get this error : "Entrypoint isn't within the current project."
Invalidate Caches and Restart, flutter clean, quitting and restarting Android Studio are some options I tired with no success at all.
Have any of you faced the same issue? What can be the problem? And please the solution...
Thanks in advance, Oz
Here's the image of Run Config :
Upvotes: 2
Views: 5202
Reputation: 11
For me, right clicking on the root Flutter project and selecting "Mark Directory As" -> "Sources Root" fixed the issue.
Upvotes: 1
Reputation: 1
It works for me, hope it will work for everyone.
Goto File -> Project Structure -> Module
Or
in edit configuration, just name it "main" and locate the location of 'main.dart' file in the Dart entrypoint text field.
Please take a look at the below screenshot.
Run/Debug Configuration screenshot
Upvotes: 0
Reputation: 3611
Click on File-> Project Structure -> Module then add root folder of your project then it will detect its a flutter app and then build
Upvotes: 3