skip to Main Content

I am using Android Studio as SDK Platforms and SDK Tools. Currently, I have a problem when running the android emulator using Visual Studio. I have checked flutter doctor and no issues has been found. However, it shows an error as below.

enter image description here

As i run flutter run –verbose to search for the problems, it shows more details of the error as below
enter image description here

3

Answers


  1. Chosen as BEST ANSWER

    Just for sharing. Since I installed android studio, visual studio and flutter in my device using windows 11 pro, it doesn't work. However, I solved this problem by downgrading the Windows version into Windows 10 Home and it solved this particular problem. Anyone who face the same issue might try this in your current device.


  2. To solve your error you have to update your compileSDKversion to the newest version which is currently 31.

    You can find the compileSDKversion inside android > app > build.gradle

    android {
    
      compileSdkVersion 31
    
      ...
    
    }
    

    Note: you have to close and open android studio again

    Login or Signup to reply.
  3. This look like gradle compatibility issue.

    Step to solve.

    • create new flutter project. try to compile the prject, if it work fine.
      compare the android folder with yours and replace what is missing with the new flutter project you created.
    • sync your project after.
    • file/invalidateCache
    • flutter clean
    • flutter pub get
    • flutter run

    you should be fine

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search