[!] Android toolchain - develop for Android devices (Android SDK 27.0.3) >>• Android SDK a ..\\Android\\sdk • Android NDK location not configured (optiona
For those of you who are on Linux and keep getting errors during flutter doctor --android-licenses
.
I kept getting the could not create settings warning when trying to accept licenses, which I fixed by specifying SDK location:
sdkmanager --sdk_root=/home/adel/bin/android-sdk --licenses
Sdkmanager then printed: all SDK package licenses accepted.
However Flutter kept giving the android license status unknown error. And attempting to call flutter doctor --android-licenses
would give me the same could not create settings error I used to get.
To fix this I edited the sdkmanager
script located in ${your android tools location}/tools/bin/ and changed the last line from:
exec "$JAVACMD" "$@"
To:
exec "$JAVACMD" "$@" --sdk_root=/home/adel/bin/android-sdk
This would make Flutter call sdkmanager while passing the needed sdk_root argument, a final call to flutter doctor --android-licenses
fixed the issue.
I did not have to use Java 8.
I was facing issue. The tools
folder was also missing from the Android SDK
folder. I believe tools
folder appears only after installing Android SDL tools(obsolete
). This option was not available for me.
Solution:
I upgraded the Java
from version 8 to version 12 and I was able to install the tools. You may still get the error Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
while giving the command flutter doctor -v
. Run the command flutter doctor --android-licenses
, the licences will be reviewed when you click yes
every time this question appears Accept? (y/N):
Hopefully it will help someone.
AndroidSDK
.WARNING: This answer is useful if you have problems with JAVA_HOME environmental variable and the direction of that. If you do not have this problem, you should not try this solution.
If you have this error and you tried with flutter doctor --android-licenses or sdkmanager --licenses and you got a problem with your JAVA_HOME environmental variable, then you have to read this.
I have a MacOS Catalina ant I could resolve this problem successfully with the next steps:
Please, let me know if you have doubts.
I downgraded my Java version to 1.8 and its resolved, here is the link to download JDK8
Run the following command after installing JDK8
flutter doctor --android-licenses
If you use homebrew cask, you can do
brew cask install android-sdk
mkdir ~/Library/Android/sdk/tools
ln -s /usr/local/bin/ ~/Library/Android/sdk/tools/bin
flutter doctor --android-licenses