Search code examples
androidfluttermacos-catalinaandroid-sdk-manager

flutter doctor --android-licenses not working on macOS Catalina


Recently I upgraded my Mac to Catalina.

I installed Java, set JAVA_HOME to $(/usr/libexec/java_home) as per the documentation. I installed Android Studio and SDK tools and set the ANDROID_HOME variable to /Users/username/Library/Android/sdk.

I downloaded flutter, and added flutter/bin to my env variable $PATH, and when I run flutter doctor, it's running fine and giving me the results as expected, without all the features checked however as I am setting it up for the first time.

But when I run flutter doctor --android-licenses, it's giving me an error which says:

Android sdkmanager tool was not found, try re-installing or upgrading your Android SDK.


Solution

  • Run the command flutter upgrade.

    Then run the command flutter doctor --android-licenses.

    Actually it was the then latest version of Flutter 1.12.13+hotfix.8 installed, which was not reading the cmdline-tools folder from the latest Android SDK home.

    Also to be on the safer side, just create a folder tools inside <path-to-sdk-home>, and copy the contents of <path-to-sdk-home>/cmdline-tools/latest/ to the folder <path-to-sdk-home>/tools/.