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.
As i run flutter run –verbose to search for the problems, it shows more details of the error as below
3
Answers
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.
To solve your error you have to update your
compileSDKversion
to the newest version which is currently 31.You can find the
compileSDKversion
insideandroid > app > build.gradle
Note: you have to close and open android studio again
This look like gradle compatibility issue.
Step to solve.
compare the android folder with yours and replace what is missing with the new flutter project you created.
you should be fine