obada ageeb
obada ageeb

Reputation: 73

Get error when i open the android folder in flutter project red lines in build.gradle any idea

I am trying to use fire-base when i am make a new project in flutter every things is fine but when i open the android folder in my project i get an error at this line of android>app>build.gradle any idea please

throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")

enter image description here

Upvotes: 3

Views: 5809

Answers (2)

byhuang1998
byhuang1998

Reputation: 417

the following steps might help you.

open your android project in flutter and select in this window, it won't show any error. Then re-open your flutter project and select in this window, you will find everything is OK.

Upvotes: 1

timr
timr

Reputation: 6962

Assuming you have a successful installation of:

  • Android Studio
  • Flutter SDK (you can check if you run flutter doctor in your terminal
  • You have defined the Flutter sdk on your $PATH (Flutter doctor should tell you)

I also found it difficult to open the Android folder in Android Studio.
What worked for me however was:

Remove the .idea/ folder for your project

I'm not sure if this step is necessary, but I always do it when I have conflicts opening project in either Android Studio or Intellij.
This is basically where it keeps its configuration.
enter image description here

Open up Android Studio

Click on Open an existing Android Studio project
enter image description here

Select the android folder from your project

enter image description here

Hope that helped

Upvotes: 1

Related Questions