I am new and my problem is with gradle and its upgrades. I can't seem to run the app I am working on and emulator works but a black screen comes up with trying to run app. Only thing I notice is this code.

GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")enter image description here


Solution 1: Umair Jibran

If you open Build.gradle using Flutter it will show this error, you can open Build.gradle using this method. Close this project >> Open Existing Android Studio Project >> then go to your project and open Android Folder via Android Studio if you want to work on Build.gradle

additionally, just to be safe

make sure you have set flutter sdk in Environment setting by: RightClick on ThisPC >> Properties >> Advanced System Settings >> Environment Variables.


Solution 2: Sanka Geethanjana

I think You have error in build.gradle - New Properties and Gradlexception.that's the way of Reslove the problem.

  1. change compileSdkVersion 30 and targetSdkVersion 30 like this
  2. Next go to Project Structure -> project -> Project SDK That place have view In no SDK.if Click dropDown and Select Android API30 platform version
  3. Then Go to Modules Click Module SDK dropdown and Select Android API30 platform version
  4. Then click Okay.
  5. Now Sure first error is slove then add throw new FileNotFoundException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") Except this throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")

Thank you.Thats Help For you.

LIke this