After installing Flutter and Android Studio on Windows, you run the following command:
A common problem you might encounter after installing Android Studio is that Android Studio is not found. This is fixed by setting the Android Studio Directory with this command (assuming the default install path):
flutter config --android-studio-dir="C:\Program Files\Android\Android Studio"
Afterward, you might be asked to accept the Android license.
You can do so with this command:
flutter doctor --android-licenses
What you will now encounter after running the license acceptance would be the exception error.
Choose the SDK Tools tab and check the “Android SDK Command-line Tools (latest)”. Click OK.
Run flutter doctor command again and now everything should be good.