Could not read script 'C:\flutter\packages\flutter_tools\gradle\app_plugin_loader.gradle' as it does not exist

Viewed 2629

I get this error when i run a project on VS code. Could not read script 'C:\flutter\packages\flutter_tools\gradle\app_plugin_loader.gradle' as it does not exist. How can i solve it?

3 Answers

Try flutter pub cache repair this should re-download all the packages and fix any package issues.

try deleting the android folder and run flutter create . from the same level as the android folder

For android studio Problem is because Android Studio doesn't know where Flutter is installed in your machine. Same applies to visual studio flutter... You need to explicitly specify this in local.properties file like I've done below. (If you have already specified it, make sure you go to that location on your PC to be sure that the location was 100% correct and its all there):

(Values used in code below is Just for example.. See my picture for how it looks on an actual machine)

sdk.dir=C:\Users\location of where your android sdk is flutter.versionName=1.2.0 flutter.sdk=C:\Users\location of where your flutter is

Picture example enter image description here

Related