Reputation: 3656
I have been going around in circles with this issue, there are so many people who have issues similar to mine, but not one of them is the same. I am trying to get flutter fully set up, but can't resolve one of the issues.
When I run flutter doctor -v
I get the following output:
[√] Flutter (Channel stable, v1.12.13+hotfix.8, on Microsoft Windows [Version 10.0.18362.657], locale en-GB)
• Flutter version 1.12.13+hotfix.8 at C:\flutter
• Framework revision 0b8abb4724 (3 weeks ago), 2020-02-11 11:44:36 -0800
• Engine revision e1e6ced81d
• Dart version 2.7.0
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at C:\Users\%username%\AppData\Local\Android\Sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.3
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
X 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)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 43.0.2
• Dart plugin version 192.7761
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
[√] VS Code (version 1.42.1)
• VS Code at C:\Users\%username%\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.8.1
[√] Connected device (1 available)
• AOSP on IA Emulator • emulator-5554 • android-x86 • Android 9 (API 28) (emulator)
! Doctor found issues in 1 category.
And if I try to run the command flutter doctor --android-licenses I get:
Android sdkmanager tool not found (C:\Users%username%\AppData\Local\Android\Sdk\tools\bin\sdkmanager). Try re-installing or updating your Android SDK, visit https://flutter.dev/setup/#android-setup for detailed instructions.
And it's right, there is no "tools" folder in my SDK folder. How on earth do I fix that? I have installed all the SDK tools, even the NDK (not that flutter picks that up) I have tried creating a tools folder and copying sdkManager.bat (including the bin folder) from build-tools, but that just tells me to update my SDK manager, which when attempted just fails.
It looks like everything still works, it just makes me a little uncomfortable having that issue there.
Any help is much appreciated.
Upvotes: 294
Views: 383270
Reputation: 1442
Resolving Flutter Android SDK Installation Issues on macOS
I encountered a problem where the Android SDK would not reinstall due to the presence of old SDK files at /Users/{my_user_name}/Library/Android/sdk
. To address this issue on macOS where the Library
directory is hidden, here are the steps I followed:
Reveal Hidden Files in Finder:
Command
+ Shift
+ .
(dot) to toggle the visibility of hidden files and folders.Remove the Old SDK Directory:
/Users/{my_user_name}/Library/Android/sdk
.Reinstall Android SDK Command-line Tools:
Settings
-> Android SDK
, or Languages & Frameworks
-> Android SDK
.SDK Tools
tab, check Android SDK Command-line Tools (latest)
which should have the status 'Not Installed'.Apply
to start the installation.Accept Android Licenses:
Cmd
+ Space
and type Terminal
).flutter doctor --android-licenses
and accept the licenses as prompted.Restart Android Studio:
Verify the Flutter Setup:
flutter doctor
.This method resolved the Flutter Android SDK installation issues on my macOS system. Android Studio Hedgehog | 2023.1.1, macOS Sonoma 14.1.1, Apple M1 Chip
Upvotes: 2
Reputation: 85
If you have sdkmanager
in the env, you can run the command:
sdkmanager --install "cmdline-tools;latest"
If it is not defined as an environment variable, you can go to the sdkmanager
folder and run it there.
It would be something like this below:
/home/User/path-Android/cmdline-tools/bin/sdkmanager --install "cmdline-tools;latest"
And then just run flutter's doctor again.
Upvotes: 4
Reputation: 1907
Android toolchain - develop for Android devices
X cmdline-tools component is missing
Run path/to/sdkmanager --install "cmdline-tools;latest"
This error means your "Android SDK Command-line Tools are missing"
IT WILL START DOWNLOADING the missing component
Upvotes: 173
Reputation: 111
Run 'flutter config --android-'flutter config --android-sdk <path-to/android/sdk>sdk <path-to/android/sdk>
Upvotes: 1
Reputation: 4289
Open sdk manager from here
Navigate to the panel titled "SDK Tools"
Then, select **Android Sdk Command-line Tools
Note: If it's already checked then follow the process
Upvotes: 47
Reputation: 3034
It's almost 2022, and things seem changed a little bit.
I had my SDK installed on a separate folder and command-line tools were missing. even though I downloaded and extracted it into the SDK folder this error was still there. took me sometime to figure it out.
flutter config --android-sdk <path-to-your-android-sdk-path>
<sdk folder>/cmdline-tools/latest/`
|- bin
|- lib
|- ...
Alternatively, use the following command from any directory of command-line tools you have:
<cmdline-tools folder>\bin\sdkmanager --install "cmdline-tools;latest" --sdk_root=<sdk folder>
this may however need you to have relatively new sdkmanager to do the job. so it may not give you expected result if it is too old.
PS: it is not working if the content is under <sdk folder>/tools
, <sdk folder>/cmdline-tools
or <sdk folder>/cmdline-tools/tools
Upvotes: 24
Reputation: 971
I have noticed when running android studio from commandline:
Observed package id 'build-tools;32.0.0-rc1' in inconsistent location '/home/kobi/Android/Sdk/build-tools/32.0.0-rc1-2'
(Expected '/home/kobi/Android/Sdk/build-tools/32.0.0-rc1')
after I changed the export path in ~/.bashrc
,
flutter doctor
was able to recognize and said all is ok.
(though had to accept licenses)
Upvotes: 0
Reputation: 31
No need to uninstall android studio what you need to do is just go to the andriod studio app go to android sdk and install cmdline toolkit then close the app and type flutter doctor you will get it installed
Upvotes: 2
Reputation: 49
C:\Users\ABC\AppData\ABC\Android\Sdk
flutter doctor --android-licenses
flutter doctor
and you should be good.Upvotes: 4
Reputation: 8856
I have just hit the same issue - my resolution was a little simpler:
Just like you, I have Android Studio installed, the key is to install Android SDK Command-line Tools, steps being:
At that point, you will be prompted to accept the SDK license and the command line tools will be installed. Your license issue should now be resolved.
FYI, the command line tools will add a new folder cmdline-tools
inside your SDK Folder. If you look in there cmdline-tools/latest/bin you will see sdkmanager - but your license issue should already be resolved.
Upvotes: 884
Reputation: 641
Go to settings:
Go to the Android SDK:
Uncheck the command-line tools:
Check Show details and uncheck the Android command-line tools and then click on Apply then click OK.
Download this package from https://developer.android.com/studio and extract it. Then go to your android sdk location (C:\Users\Pooja\AppData\Local\Android\Sdk) and paste it with the name tools.
Then close and restart Android Studio and check for updates. After installing updates, close Android Studio.
Open the command line and enter:
flutter doctor --android-licenses
And, finally, press y
for accept.
All we be solved.
Upvotes: 63
Reputation: 195
From https://flutter.dev/docs/get-started/install/windows :
Warning: In Android Studio 3.6 or later, you need to manually add the old version of the Android SDK Tools for Flutter to work. To do this:
Open the Android Studio SDK Manager
In the Android SDK tab, uncheck Hide Obsolete Packages
Check Android SDK Tools (Obsolete)
...
This is a known issue that will be addressed in an upcoming version of Flutter.
Upvotes: 13
Reputation: 63
I encounter the same issue as yours. What I do is to (at least for now...):
Upvotes: -1