Home > database >  Cannot resolve symbol after upgrading Flutter
Cannot resolve symbol after upgrading Flutter

Time:02-26

After upgrading to latest flutter (2.10.2), there are errors on build.gradle in both my own project and other packages.

Error: Cannot resolve symbol 'Properties'

def localProperties = new Properties()

Error: Cannot resolve symbol 'FileNotFoundException'

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

How should I modify the issues, and should I modify even if it is not in my own project?

Edit: Based on @Jai Techie comment, I tried to check the Project SDK and it was set to No SDK. I have a lot of options:

Android API 27 Platform java version "1.8.0_242"
Android API 28 Platform version 11.0.11
Android API 29 Platform java version "1.8.0_242"
Android API 30 Platform java version "1.8.0_242"
11 version 11.0.11
Android Studio java home version 11.0.11
Embedded JDK version 11.0.11

I tried to select the Android API 30 because it seems the latest one (I based only using the number) but it still has the same issues. I tried to change to 11 version and the issues now are gone. So now I'm not sure if what I'm doing is correct. Any comments? Thanks!

Edit: I found this so I guess 11 was the latest on my case. https://developer.android.com/studio/releases/platforms

CodePudding user response:

Can you do one thing if u r using widnows then pleas follow this :

 First go inside where your flutter sdk is save 
 in your system clear cache and then go to bin directory of flutter sdk and 
 copy path,
 Go inside enviornment var in your system and new path and paste bin path of 
 your flutter sdk

Then go inside terminal try to run flutter clean .

CodePudding user response:

Try to clear chache

  1. Kill the chache in your Android Studio File -> Invalidate Chache / Restart
  2. And restart your Android Studio
  • Related