Ankit
Ankit

Reputation: 669

Flutter sdk not found. The error in GradleException in the build.gradle

I am developing a flutter application and I am having certain errors. The flutter SDK location is rightly provided but it says that Flutter SDK not found.

The error is arising from the file build.gradle inside the android folder:

if (flutterRoot == null) {
    throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

I am even trying to change it but it says that "Cannot resolve symbol 'GradleExecption'". I am also having the same error in the AndroidManifest.xml file where I am specifying the "android:icon: drawable/app_logo.png" but it says that "Cannot resolve symbol 'drawable'".

Can someone help me with this please?

Upvotes: 0

Views: 1712

Answers (3)

Fildogan
Fildogan

Reputation: 1

Try changing:

GradleException()

to:

FileNotFoundException()

Upvotes: 0

lava
lava

Reputation: 7373

1 if (flutterRoot == null) { throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") } cntrl+Alt+S then show settings window then search flutter you can see in under language and framework .Add flutter sdk path. enter image description here

Here you verify the above path and restart the ide(Android Studio) path :.android/local.properties enter image description here

2 I am also having the same error in the AndroidManifest.xml file where I am specifying the "android:icon: drawable/app_logo.png" but it says that "Cannot resolve symbol 'drawable'".

check your path string add @withdrawable eg: android:icon="@drawable/app_logo.png" enter image description here

Upvotes: 1

JOSHUA JAMES
JOSHUA JAMES

Reputation: 16

Maybe try running Flutter Doctor and see what it gives you, if that doesn't yield anything, then try checking if the PATH for Flutter is correct

Upvotes: 0

Related Questions