19

Unable to run flutter from Android Studio not detecting flutter project its shows Error: Entry point isn't within the current project

Every time restart android studio same error message shows

enter image description here

Catarina Ferreira
  • 1,750
  • 5
  • 16
  • 25
selva kumar
  • 201
  • 1
  • 2
  • 7

12 Answers12

40

Delete the .idea folder inside the root of the flutter project and restart Android Studio.

Refer to this question: What is the .idea folder? and make your decision if it's safe or not to delete .idea folder.

MendelG
  • 8,523
  • 3
  • 16
  • 34
Maddu Swaroop
  • 3,277
  • 2
  • 18
  • 32
18

Click on File-> Project Structure -> Module then add root folder of your project then it will detect its a flutter app and then build and work

its work for me

Reference: https://github.com/flutter/flutter-intellij/issues/2307

Shamim Shaikh
  • 637
  • 6
  • 12
12

1) make sure flutter and dart sdk paths are properly configured from

File-> Settings..->Languages and Frameworks as well as make sure Dart support is enabled for project module from Dart Option enter image description here

2) at the end select File->Invalid caches and restart

enter image description here

3) so after 2nd step you may get in File->Project Structure.. option from there Select Modules then just simply add only root folder path of your flutter project and repeat just above 2nd step for me this worked

David Buck
  • 3,594
  • 33
  • 29
  • 34
Akash Anaghan
  • 381
  • 5
  • 8
6

Syncing your project with gradle files will solve it:

enter image description here

Mazin Ibrahim
  • 6,531
  • 2
  • 29
  • 38
4

You can sync the files with Gradle, within the File menu.

Else You can re-include the files/project root folder inside the File Menu.

File -> Project Structure -> Module

And then add the root folder of the project(with + icon), then it will detect that it's a flutter app again, and then build and work again.

3

Try delete .idea folder inside project folder and Invalidate & Restart Android Studio.

zia khan
  • 313
  • 3
  • 14
3

For me my project was missing the pubspec.yaml file, it was deleted by mistake , instead of warning about the missing file , I got this error

enter image description here

yehyatt
  • 2,107
  • 3
  • 26
  • 29
2

This problem happened to me

I solved it this way

Go to the Android Studio track

I have this way

C:\Users\mustafamaxL\.AndroidStudio4.0\system

Remove folder (caches)

Then, start Android Studio again

Mustafa Max
  • 59
  • 2
  • 9
1

If your ios, android, or lib folders are missing, it typically means there is something wrong with your project structure.

To fix it, delete the .idea folder in the root of your project and then restart Android Studio. If you're using a Mac, you can display the hidden .idea folder by pressing Command+Shift+Dot in Finder.

The .idea folder will be automatically regenerated and everything should be back where it belongs.

See this post for the original solution.

Joe Muller
  • 5,743
  • 1
  • 27
  • 44
0

I faced the same issue today and tried other solutions here but it wasn't worked at all.

In my case I deleted three folders that is android, ios, and .idea from project directory, then restarted android studio and finally I gave this command in Android Studio's Terminal.flutter create . to create appropriate directories (i.e., android & ios).

Now it is working fine.

Note: Before deleting the android / ios directory please make a backup of these directories only if you previously gave native code in android / ios directory.

Hope this solution will helpful if others will not work.

dipakbari4
  • 750
  • 1
  • 10
  • 16
0

The .idea folder will also be deleted on Linux. When Andriod Studio opens, click terminal at the bottom in Android Studio. Then type remove -r .idea/ in the terminal and press enter. After deleting, close and restart Android Studio.

onur k
  • 23
  • 6
0

You might need to update the Gradle version. Or change the minimum android SDK version.

Here is worked for me:

Update Gradle / minSdkVersion version

  1. Reopen the project but at the directory user/StudioProjects/yourFlutterApp/android. After it is opened it will load some packages (see right bottom), which will take some time.
  2. It will ask you to update the Gradle version (right-left corner) or go under File>Project Structure Project you can set a higher Gradle version and under Modules variables of your build
  3. Now you can sync your project with Gradle files

After configuration, you might need to restart your project with File>Invalid Caches/Restart....

Paul
  • 588
  • 6
  • 16