4

This just started happening randomly. The app runs fine, but most valid imports are not recognized. This is happening with packages and local files.

I've restarted and Android Studio, did a pub cache repair, flutter clean, uninstalled and reinstalled the android studio flutter plugin, tried opening in VScode, nothing is helping.

Other people on my team have pulled my same repo and they are not experiencing this problem.

Any Ideas?

enter image description here

Derek Hannah
  • 537
  • 7
  • 23

3 Answers3

3

Most of the issue should be resolved by android studio "invalidate cache and restart" action.

Dogar277
  • 71
  • 2
  • 6
0

I faced to this problem and restarted Android Studio some times and it continue still not working. So, I changed the name of import and putted just the name of the file. Example: import 'authentication.dart'. Without the whole 'package:.../'.

If you're importing packages, try this in the terminal (same directory of the project):

with pub:

$ pub get

with flutter:

$ flutter pub get
-1

Its work for me

Bottom Menu -> Dart Analysis -> Restart Dart Analysis Server

OR try

flutter pub get

Until recognize valid imports

vishwajit76
  • 2,300
  • 20
  • 16