[!] Android toolchain - develop for Android devices (Android SDK 27.0.3) >>• Android SDK a ..\\Android\\sdk • Android NDK location not configured (optiona
MacOS 10.15: Android Studio 3.5.1:
The solution that works for me was to use the Java Environment tool jenv (installed via homebrew). This tool changes the $JAVA_HOME when one switches between java versions.
In my case I have multiple Java versions installed and the current global version in use was the default. I also found it necessary to comment out the $JAVA_HOME environment variable in my .bash_profile when using this tool.
In Terminal, I entered jenv global 1.8 to get java 1.8 running instead of a later version (I have multiple versions installed).
After that:
flutter doctor --android-licenses
OR
sdkmanager --licenses
both work fine.
Note: You may need to exit and reopen your Terminal shell if you have to redefine the $JAVA_HOME environment variable.
The right solution would be if you have android studio installed then
Android SDK Tools (Obsolete)flutter doctor and it should now prompt you to run flutter doctor --android-licenses
once you run the license command accept all licenses by hitting y and it should solve the problemHere are the steps that solve my problem:
flutter doctor --android-licensesy to accept, this process may occurred several times. Done!I faced the same problem, like mentioned above I tried these.
This is what worked for me:
flutter doctor --android-licenses and select y for the promptsflutter doctor and everything will be fine!!!!Follow these simple steps.
For someone who is still facing the issue:
As answered below by Tommie C, Aba and few other people, but may not be clear enough as I found it.
Try installing java 1.8 manually as described here on windows/linux: [https://www3.ntu.edu.sg/home/ehchua/programming/howto/JDK_Howto.html]
and setting $JAVA_HOME variable(jdk path).
On windows set jdk path($JAVA_HOME) : [How to set java_home on Windows 7?.
On linux: [https://askubuntu.com/questions/175514/how-to-set-java-home-for-java].
Then run flutter doctor --android-licenses and accept all the licenses. Hope it helps.