Search code examples
androidfluttersdk

Flutter debugging fails due to target has string "android-31"


So I'm new to flutter, I'm trying to get the app running with debugging inside VSCode.
I start the emulator, and then hit "Run and debug".

I get the following error:

Failed to find target with hash string 'android-31' in: C:\Users\97250\AppData\Local\Android\sdk

I have installed Android SDKs and build tools.
enter image description here

enter image description here


Solution

  • Solved! The problem was that my android-31 inside the sdk folder was named android-31.delete for some reason.
    Delete the folder and reinstall the SDK from Android Studio.