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.
- change
compileSdkVersion 30
andtargetSdkVersion 30
like this - Next go to
Project Structure
->project
->Project SDK
That place have view In no SDK.if Click dropDown and SelectAndroid API30 platform version
- Then Go to
Modules
ClickModule SDK
dropdown and SelectAndroid API30 platform version
- Then click Okay.
- 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 thisthrow new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
Thank you.Thats Help For you.