I\'ve been programming in Flutter using macOS 10.15.3, targeting iOS devices. Today I tried installing Android Studio also, to branch out. The installation went without erro
If you are using Java 11 or higher, you just you need jaxb libraries which are not included in JDK 11/12 when it runs (especially on Win 10).
Follow the below steps:
Download wget tool from the location -> https://eternallybored.org/misc/wget/ and set the environment variable path in your computer to run wget command in cmd prompt
Locate your Android SDSK\tools folder (<ANDROID_SDSK>\tools) and change directory to it with the cd command: cd <ANDROID_SDSK>\tools
Execute the below commands inside the tools folder:
mkdir jaxb_lib
wget https://repo1.maven.org/maven2/javax/activation/activation/1.1/activation-1.1.jar -O jaxb_lib/activation.jar
wget https://repo1.maven.org/maven2/com/sun/xml/bind/jaxb-xjc/2.3.2/jaxb-xjc-2.3.2.jar -O jaxb_lib/jaxb-xjc.jar
wget https://repo1.maven.org/maven2/com/sun/xml/bind/jaxb-core/2.3.0.1/jaxb-core-2.3.0.1.jar -O jaxb_lib/jaxb-core.jar
wget https://repo1.maven.org/maven2/org/glassfish/jaxb/jaxb-jxc/2.3.2/jaxb-jxc-2.3.2.jar -O jaxb_lib/jaxb-jxc.jar
wget https://repo1.maven.org/maven2/javax/xml/bind/jaxb-api/2.3.1/jaxb-api-2.3.1.jar -O jaxb_lib/jaxb-api.jar
wget https://repo1.maven.org/maven2/com/sun/xml/bind/jaxb-impl/2.3.2/jaxb-impl-2.3.2.jar -O jaxb_lib/jaxb-impl.jar
wget https://repo1.maven.org/maven2/com/sun/istack/istack-commons-runtime/3.0.8/istack-commons-runtime-3.0.8.jar -O jaxb_lib/istack-commons-runtime.jar
Goto the <ANDROID_SDSK>\tools\bin folder and edit sdkmanager.bat and avdmanager.bat files with your favourite text editor (notepad will do).
Paste the below code before the statement ‘@rem Execute sdkmanager’ to set classpath.
set CLASSPATH=%CLASSPATH%;%APP_HOME%\jaxb_lib\jaxb-api.jar set CLASSPATH=%CLASSPATH%;%APP_HOME%\jaxb_lib\jaxb-core.jar set CLASSPATH=%CLASSPATH%;%APP_HOME%\jaxb_lib\jaxb-impl.jar set CLASSPATH=%CLASSPATH%;%APP_HOME%\jaxb_lib\jaxb-jxc.jar set CLASSPATH=%CLASSPATH%;%APP_HOME%\jaxb_lib\jaxb-xjc.jar set CLASSPATH=%CLASSPATH%;%APP_HOME%\jaxb_lib\activation.jar set CLASSPATH=%CLASSPATH%;%APP_HOME%\jaxb_lib\istack-commons-runtime.jar
Finally execute: <ANDROID_SDSK>\tools\bin\sdkmanager --update
We are all done. Now run flutter doctor and now your android license status error should go away. Cheers!!!
What worked for me:
$ flutter doctor --android-licenses -v Android sdkmanager tool not found (/Users/juarse1/Library/Android/sdk/tools/bin/sdkmanager). Try re-installing or updating your Android SDK, visit https://flutter.dev/setup/#android-setup for detailed instructions.
throwToolExit (package:flutter_tools/src/base/common.dart:28:3) AndroidLicenseValidator.runLicenseManager (package:flutter_tools/src/android/android_workflow.dart:311:7) Doctor.diagnose (package:flutter_tools/src/doctor.dart:243:38)
This is because Android SDK is not finding command tools, but this needs to be forced to pull from obsolete package, so: 3. Go to Android Studio -> Preferences -> System Settings -> Android SDK -> SDK Tools Section 4. Uncheck Hide Obsolete Packages at the bottom 5. Make sure BOTH options are checked:
Android SDK Platform-Tools AND Android SDK Tools (Obsolete)
The problems seems to be that in java 11 ( or 9 and 10 ) the jaxb libs are not included in the JDK and android studio sdkmanager can't read the licenses xml files. You have to include this libs on the classpath (if you are using Java 11), you can follow the instructions posted here (it worked for me in Windows 10)
https://medium.com/@parsher/flutter-android-sdkmanager-update-with-jdk-12-ad8098165472
The last step is not necessary. After included the classpath lines, run de flutter doctor and everything should be all right.
Seems like latest version of Android SDK renamed the 'Android SDK tools' package into 'Android-SDK command line tools'.
But unfortunately current stable version of the Flutter SDK (v1.12.13+hotfix.8
) is not compatible with this change and it keeps showing error message.
Workaround:
As @Mark Ebden suggested, You can simply Uncheck Hide Obsolete Packages checkbox on the SDK tools page and you'll see Android SDK Tools (Obsolete) 26.1.1. Install it and you are good to go. If you find anything missing, read the following detailed instructions.
See this issue on flutter repo for more info.
Here is the complete details you want while installing android studio with latest version of Mac OS.
1. Install Android Studio stable version.
2. Open android studio
3. open SDK manager. See the screen shot below.
4. Make sure you have downloaded all required stuff. See the screenshots below.
Please note that, I am using a custom location (/Users/darish/development/sdk/android) for my Android SDK instead of the default location (Library/Android/sdk/)
5. Go to your home directory and check whether there is a .bash_profile or not. If yes, open it, if no, create one. Add the following contents to that file.
export PATH="$PATH:~/development/sdk/flutter/bin"
export ANDROID_HOME="/Users/darish/development/sdk/android"
export PATH="$PATH:$ANDROID_HOME/platform-tools"
6. Once all the above steps are done, run flutter doctor --android-licenses and accept all licenses.
flutter doctor --android-licenses
7. Now run flutter doctor to see everything ok. If you need any further assistance, let me know. :)
That's all, have a nice day :)