Firstly, Look at the screenshot that I’ve attached, It is giving me red lines (look to the right) in my entire code (386 errors in 766 lines) all of a sudden (This project was working perfectly fine last time I tested it), It is saying that the import package line is not valid, I thought it would be something with the SDK so I redownloaded Dart SDK but still getting the same error, I redownloaded flutter zip file and added it to my path, also updated it’s path in project settings still didn’t work, I tried running flutter doctor command and it is saying everything is perfect, I have selected Android SDK too still no help, I even tried reinstalling Android Studio, didn’t work either.
(Please help me out with it 🙁 My First Internship is starting soon and I cannot work without android studio)
I have a feeling that it has to do something with the configuration but I can’t figure out what to change :/
3
Answers
Actually It was very easy to fix, Just run
It will work after running this command
Try any or all of these
gradle-wrapper.properties
in your app within Android Studio. Make sure the second linedistributionUrl=https://services.gradle.org/distributions/gradle-7.2-bin.zip
is the latest version which is 7.2.This happens to me sometimes. I do the following which usually fixes it.
The project will rebuild when Android Studio starts back up and the errors should be gone.