0

I am trying out flutter and have installed all needed dependencies and am trying to run the flutter template as a Windows Application. But I just can not get a flutter run configuration working, since it always is telling me "entrypoint file not found at main.dart".
(Cannot really provide any pictures here, since the the run configuration does not allow me to browse the project files or select anything else. All Configuration I can do is set the Dart_entrypoint field manually to main.dart or lib\main.dart or any .\lib\main.dart which all result in above mentioned error)

But running "flutter run" via the terminal works fine and starts the Application, so my question is, how do I get the run configuration in Android Studios working?
Project File View:
Project File View

Porject view:
Porject view

Barry
  • 337
  • 1
  • 2
  • 15
  • 2
    Try this: from File -> Project Structure -> Module And then add the root folder of the project, then it will detect that its a flutter app again, and then build and work again. – MahMoos May 24 '21 at 22:40
  • thanks I will try it as soon after my classes are over for today – Barry May 25 '21 at 09:58
  • It worked! Thanks a lot. The issue was that I somehow renamed the project folder, hence causing the project settings to point to a non existing directory. And doing what you (@MahMoos) said made the ide compile the project. – Barry May 25 '21 at 14:42
  • @MahMoos hi, could you please help this one? it seems similar https://stackoverflow.com/questions/72041493/cant-find-main-dart-as-entrypoint-how-to-connect-android-project-to-the-main-d – Alexa289 Apr 28 '22 at 09:49

1 Answers1

1

You have to reset the project module to solve this. From File>Project Structure go to Modules inside ProjectSettings, and add a new module.

Select Flutter and name the module on the next page and select the path to the project directory.

MahMoos
  • 1,014
  • 9
  • 16