skip to Main Content

my flutter doctor
enter image description here

i get this error when i run flutter doctor --android-licenses
android sdk manager not found. update to the latest android sdk and ensure that the cmdline-tools are installed to reslove this

this is my env
enter image description here

this is my cmdline-tools
enter image description here

my android studio sdk manager
enter image description here

2

Answers


  1. If you encounter the "android sdk manager not found" error when running flutter doctor --android-licenses, it typically indicates that the Flutter SDK is unable to locate the Android SDK on your system. To resolve this issue, follow these steps:

    1. Install Android SDK: Make sure you have the Android SDK installed on your system. If you haven’t installed it yet, you can download it from the official Android website: https://developer.android.com/studio#downloads

    2. Set ANDROID_HOME Environment Variable**: After installing the Android SDK, you need to set the ANDROID_HOME environment variable to point to the location where the Android SDK is installed. The steps to set environment variables differ depending on your operating system:

      • Windows:
        • Go to "Control Panel" > "System and Security" > "System" > "Advanced system settings".

        • Click on the "Environment Variables" button.

        • Under "System Variables," click "New" and set the variable name to ANDROID_HOME.

        • Set the variable value to the path of the Android SDK (e.g., C:AndroidSDK).

        • Add the following line to set the ANDROID_HOME variable:

          export ANDROID_HOME=/path/to/your/Android/sdk
          
        • Save and close the file. Then, run source .bash_profile or source .bashrc to apply the changes.

    3. Add SDK Tools to PATH: In addition to setting the ANDROID_HOME variable, you also need to add the Android SDK’s tools and platform-tools directories to your system’s PATH variable.

      • Windows:
        • Append %ANDROID_HOME%tools and %ANDROID_HOME%platform-tools to the PATH variable in the same "Environment Variables" window where you set ANDROID_HOME.
    4. Restart your terminal: After making changes to environment variables and PATH, close and reopen your terminal or command prompt for the changes to take effect.

    5. Run flutter doctor --android-licenses: Now, try running flutter doctor --android-licenses again in your terminal. It should successfully launch the Android SDK Manager and ask you to accept the licenses for various components.

    If you followed the steps correctly, the error "android sdk manager not found" should be resolved, and you should be able to accept the Android SDK licenses successfully.

    Login or Signup to reply.
    1. Open Android Studio and Click on SDK Manager.
    2. Click on SDK tools, then select Show Package Details and navigate to Android SDK command-line tools, select version 8.0, and hit apply button.
    3. Set the Environment variable of JAVA_HOME to C:Program FilesAndroidAndroid Studiojbr
    4. Now Run the command:

    flutter doctor –android-licenses

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search