Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is causing "cannot resolve symbol GradleException" in a flutter project?

I have created a flutter project in Android Studio. The project was working fine until I open the app level gradle file as when i open is starts showing two errors 1) 'Cannot resolve symbol Properties' and 2) 'cannot resolve symbol GradleException' i click on "Open for editing in Android studio" and the error 1) disappeared butt 'cannot resolve symbol GradleException' is still there I have latest Gradle and Android Studio the project was working fine until I open this app level Gradle file. as shown

like image 486
Asim Javaid Avatar asked Nov 22 '19 21:11

Asim Javaid


2 Answers

Set Project SDK to Android API Platform version 29 (or the latest version, 30), like so:

defaultConfig {
    ...
    minSdkVersion 16
    targetSdkVersion 30
}

and update GradleException() to FileNotFoundException()

Please follow it: https://github.com/flutter/flutter/issues/29608#issuecomment-548649907

This works for me, Thanks

like image 105
warren zingwena Avatar answered Sep 19 '22 05:09

warren zingwena


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

I tried by removing "new" keyword and it somehow worked for me.

Changed

throw new GradleException

to

throw GradleException. 
like image 39
Prati V Avatar answered Sep 21 '22 05:09

Prati V