Android/Sdk is missing a Tools folder, meaing no sdkmanager, meaning "Android license status unknown" error

10,315

Solution 1

I'm facing the same issue too on MacOS.

I just downloaded the Android Studio today (android-studio-ide-192.6241897-mac) and the /tools folder is missing for me too.

The only way I can see an 'sdkmanager' inside the 'Android/' directory is when I install cmdline-tools and find it in the bin folder. but that doesn't solve the problem.

EDIT

Found the solution. Apparently, the 'tools/' folder doesn't exist in the latest Android Studion build.

You can still install the SDK tools using the SDK manager in the Android studio.

Open the SDK manager and go to the 'SDK Tools' tab. On the bottom uncheck the 'Hide Obsolete packages' checkbox.

After doing that an option to install the 'Android SDK Tools (obsolete)' package will appear.

Install them and run the flutter doctor again. And it works after accepting the licenses

Solution 2

On Ubuntu 20.04 LTS these are my steps to reconcile this problem

  1. Update to the latest version of Android Studio (currently 4.0.1). I'm using the JetBrains toolbox app to install Android studio on Ubuntu.

  2. Install flutter via snap:

sudo snap install flutter --classic
sudo snap install flutter-gallery
flutter channel dev
flutter upgrade
flutter config --enable-linux-desktop
  1. Follow the pictures below to install the command line tools and accept the license for them in Android Studio (see pictures below)

  2. Accept the licenses using flutter doctor

flutter doctor --android-licenses 5 of 6 SDK package licenses not
accepted. 100% Computing updates...         
Review licenses that
have not been accepted (y/N)? y 

Step 3: Follow the pictures to install the command line tools:

  • 3.1 Select the Command line tools (latest) in Android Studio as shown, press OK:

Android SDK Command-line Tools

  • 3.2 Accept the License agreement License Agreement

  • 3.3 Confirm the Change Confirm the Change

  • 3.4 Click Finish Click Finish

Share:
10,315

Related videos on Youtube

Joe Morano
Author by

Joe Morano

Updated on June 04, 2022

Comments

  • Joe Morano
    Joe Morano almost 2 years

    I wanted to start learning Flutter, so I'm following the guide, but I'm already stuck on the very first step. I haven't done anything other than create a brand new app, but when I hit "Run" in Android Studio I get the following error:

    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
    > Failed to install the following Android SDK packages as some licences have not been accepted.
         build-tools;28.0.3 Android SDK Build-Tools 28.0.3
         platforms;android-28 Android SDK Platform 28
      To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
      Alternatively, to transfer the license agreements from one workstation to another, see http://d.android.com/r/studio-ui/export-licenses.html
    
      Using Android SDK: /home/greg/Android/Sdk
    
    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
    
    * Get more help at https://help.gradle.org
    
    BUILD FAILED in 1s
    Finished with error: Gradle task assembleDebug failed with exit code 1
    

    Looking at people with similar problems, the most common solution seemed to be running yes | ~/Android/tools/bin/sdkmanager --licenses, but I don't have a folder or file called sdkmanager. My entire document tree is different actually, although I just went through the official Android Studio download process for Ubuntu. For my document structure, I have

    ~/Android/Sdk/$ ls
    build-tools  patcher    platform-tools  sources
    emulator     platforms  skins  
    

    none of which contain tools, bin, or sdkmanager.

    I also opened SDK Manager in Android Studio, and went to the SDK Tools tab and updated Build-Tools and accepted the license, then quit and reopened Android Studio, but I'm getting the same error. I can't find anyone with the same file structure as me. Anyone know what I can do?

    EDIT

    I'm starting to think the real issue is the contents of my Android folder. When I run flutter doctor I get this message

    [✓] Flutter (Channel stable, v1.12.13+hotfix.8, on Linux, locale en_US.UTF-8)
    [!] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
        ✗ Android license status unknown.
          Try re-installing or updating your Android SDK Manager.
          See https://developer.android.com/studio/#downloads or visit
          https://flutter.dev/setup/#android-setup for detailed instructions.
    [!] Android Studio (version 3.6)
        ✗ Flutter plugin not installed; this adds Flutter specific functionality.
        ✗ Dart plugin not installed; this adds Dart specific functionality.
    [✓] IntelliJ IDEA Community Edition (version 2019.3)
    [!] Connected device
        ! No devices available
    
    ! Doctor found issues in 3 categories.
    

    But when I run flutter doctor --android-licences I get the following error message:

    Android sdkmanager tool not found (/home/greg/Android/Sdk/tools/bin/sdkmanager).
    Try re-installing or updating your Android SDK,
    visit https://flutter.dev/setup/#android-setup for detailed instructions.
    

    I don't in fact have a tools folder, or bin, or sdkmanager. I did try uninstalling and reinstalling Android Studio, but nothing changed. Did I download an incorrect package or something? I downloaded it directly from https://developer.android.com/studio/#downloads, so how is it possible that the contents seem to be incorrect? I have 100GB free, so space constraints didn't stop it from being installed. I don't have any internet issues either.

  • Joe Morano
    Joe Morano about 4 years
    I tried that. I added the result to my question. My entire Android package seems to be incorrect, as I have no tools or bin or sdkmanager folders or files.
  • Joe Morano
    Joe Morano about 4 years
    Well this is weird..I just downloaded the Windows version and it doesn't have /tools either. Could the latest release just not have a /tools folder? That doesn't make any sense.
  • Joe Morano
    Joe Morano about 4 years
    Also, where's your bin folder?
  • posymeon
    posymeon about 4 years
    Which bin folder? the the cmdline-tools have the following structure 'Android/sdk/cmdline-tools/latest/bin' in there i can see the sdkmanager.
  • Joe Morano
    Joe Morano about 4 years
    Oh okay. Where did you install cmdline-tools from?
  • posymeon
    posymeon about 4 years
    I opened the SDK manager -> SDK Tools Tab through the Android Studio. As I remember from previous installations in the list where you see the cmdline-tools there used to be an SDK Tools checkbox, but now it doesn't exist anymore
  • posymeon
    posymeon about 4 years
    Ok, i think i found a solution, we can install the SDK Tools. Open the SDK manager and go to the 'SDK Tools' tab. On the bottom uncheck the 'Hide Obsolete packages' checkbox. After doing that an option to install the 'Android SDK Tools (obsolete)' package will appear. Install them and run the 'flutter doctor' again. And it works after accepting the licesnes.
  • Edward
    Edward about 4 years
    Same here - just downloaded latest android studio and installed on a fresh new pc - no tools folder. Windows 10, android studio 3.6.1.
  • Edward
    Edward about 4 years
    @PolychronisSymeonidis you are the winner! Your fix worked for me - please post it as the solution!
  • Joe Morano
    Joe Morano about 4 years
    Wooooow yeah that works. Good find. Why would they mark tools as obsolete when literally nothing works without it??
  • posymeon
    posymeon about 4 years
    Who knows, maybe an update in flutter will follow the new Android SDK structure. I updated the answer with the solution.