Cannot resolve symbol GradleException error

I am facing a problem that flutter sdk not found and app showing gradle Exception error.
it started happening in one of my project after I changed my app icon and then i opened build.gradle file then its suddenly starts showing this error.

I had a two days ago saved copy of my project i opened that copy project but still facing the very same error

every this is well placed . My flutter sdk is correctly placed.

Flutter Doctor showing following issues

    • Flutter version 1.22.4 at D:\apps\FlutterSDK\flutter
    • Framework revision 1aafb3a8b9 (3 weeks ago), 2020-11-13 09:59:28 -0800
    • Engine revision 2c956a31c0
    • Dart version 2.10.4

[!] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at C:\Users\Zia Choudhary\AppData\Local\Android\sdk
    • Platform android-30, build-tools 30.0.2
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
    ! Some Android licenses not accepted.  To resolve this, run: flutter doctor --android-licenses

[!] Android Studio (version 4.1.0)
    • Android Studio at C:\Program Files\Android\Android Studio
    X Flutter plugin not installed; this adds Flutter specific functionality.
    X Dart plugin not installed; this adds Dart specific functionality.
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)

[!] Connected device
    ! No devices available```

! Doctor found issues in 3 categories.

I solved it by myself


Step 1
open build.gradle file and set targetSdkVersion and compileSdkVersion to 29
Step 2
click File => Project Structure => Project then set Project SDK to Android API 29 platform
Step 3
in project structure => Module and select dependencies in right column and then set Module SDK to Android API 29 platform
Step 4
Now open build.gradle and Repalce GradleException with FileNotFoundException

You are done :sunglasses:
Happy fluttering :wink:

Flutter plugin not installed error. When running flutter doctor