skip to Main Content

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

enter image description here

3

Answers


  1. This could be due to a failed rebuild.

    1. Click on File at the top left corner on the menu bar.
    2. Click Project Structure
    3. Click on Module at the left end, then click on sources.
    4. 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 Ok at the bottom of the dialog.
    5. On the menu bar click on Build then rebuild project.
    Login or Signup to reply.
  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.

    Login or Signup to reply.
  3. I was having this issue and tried everything and nothing was working.

    Then i realised that the pubspec.yaml was not there. So i restored it with git and poof everything was working again.

    It was deleted (but not committed) and restored I it with git checkout HEAD pubspec.yaml in my case

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search