i had the same problem. tried all of the above but didn't fix it. what i did is:
Please have backups before continuing, expecially sdkmanager part

went to Environment variables and added ANDROID_HOME with a variable value of: C:\Users\%username%\AppData\Local\Android\Sdk
then my JAVA_HOME with this variable value:
C:\Program Files\Android\Android Studio\jre
then my Path with this variable value:
C:\Users\%username%\flutter\bin

Then I went to C:\Users\%username%\AppData\Local\Android\Sdk\tools\bin
and opened sdkmanager.bat with a note editor, this was my DEFAULT_JVM_OPTS:

@rem Add default JVM options here. You can also use JAVA_OPTS and SDKMANAGER_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Dcom.android.sdklib.toolsdir=%~dp0\.."

Then i ran:
flutter doctor
got output of:

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel beta, v0.2.3, on Microsoft Windows [Version 10.0.16299.309], locale en-US)
[!] Android toolchain - develop for Android devices (Android SDK 27.0.3)
    ! Some Android licenses not accepted.  To resolve this, run: flutter doctor --android-licenses
[√] Android Studio (version 3.1)
[√] Connected devices (1 available)

! Doctor found issues in 1 category.

Then i ran
flutter doctor --android-licenses
and accepted all Terms & Conditions with (y)

This solved my problems. hope it helps you.


https://github.com/flutter/flutter/issues/16025#issuecomment-377984231