I've been trying to get flutter to detect the Android SDK.
flutter doctor
returns
PS I:\Projects\Flutter\fluttertest\flutterproject> flutter doctor -v
[√] Flutter (Channel beta, v0.1.5, on Microsoft Windows [Version
10.0.16299.248], locale en-US)
• Flutter version 0.1.5 at I:\Source\flutter
• Framework revision 3ea4d06340 (7 days ago), 2018-02-22 11:12:39 -0800
• Engine revision ead227f118
• Dart version 2.0.0-dev.28.0.flutter-0b4f01f759
[!] Android toolchain - develop for Android devices
• Android SDK at C:\NVPACK\android-sdk-windows
• Android NDK location not configured (optional; useful for native profiling support)
• ANDROID_HOME = C:\NVPACK\android-sdk-windows
X Android SDK is missing command line tools; download from "link to google"
• Try re-installing or updating your Android SDK,
visit https://flutter.io/setup/#android-setup for detailed instructions.
[√] Android Studio (version 3.0)
• Android Studio at C:\Program Files\Android\Android Studio
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-915-b01)
[√] VS Code (version 1.20.1)
• VS Code at C:\Program Files\Microsoft VS Code
• Dart Code extension version 2.9.2
[√] Connected devices (1 available)
• Nexus 6P • 8XV7N16A04000597 • android-arm64 • Android 8.1.0 (API 27)
! Doctor found issues in 1 category.
I've tried downloading the SDK Tools Package and even Installed Android Studio
and added it to PATH, but was unable to resolve the issue.
The current Android installation sits in a directory called C:\NVPACK, and although I do remember fiddling with it, I don't remember which program installed it. I'm considering removing it. Any help would be greatly appreciated.
Flutter provide command to update our Android SDK path:
Use flutter config --android-sdk <path-to-your-android-sdk-path>
Or just add a variable ANDROID_HOME with your sdk location in user variables
It turns out that I had NVIDIA CodeWorks installed. I believe it was part of my VS2017 installation options. I've removed it and modified my ANDROID_HOME Environment Variable and removed all of the variables associated with the NVPACK folder. (thanks to everyone (1) who helped me offsite!)
You have to set ANDROID_HOME variable to SDK.
create a new variable by the name and set it to the installation directory.
make sure SDK is not below 2 subfolders from c drive or any windows root drive.
Open Android Studio.
Click on Tools go to Sdk manager.
Then click on SDK tools.
Unchecked Hide Obsolete Packages then Check Android SDK Tools.
Then Tools will be install after that you can set the path and check the connectivity.
Your problem will resolve.
Go into C:\Users\asus\AppData\Local\Android\sdk, double cliclk on sdk mannager.exe and update all packages.
It will take around 10 minutes to update which also depends on your internet speed.
You need to install the command-line tools inside Android studio, as explained here:
Flutter doctor error - Android sdkmanager tool not found. Windows
For Mac Users use:
flutter config --android-sdk /Users/<your-user>/Library/Android/sdk
I have installed Flutter with Android Studio many times. And I found most of the installation errors were because of poor network connection. When I use fast internet service, Flutter Environment was set up within an hour without any issue.
Internet speed is very important while Flutter, Android Studio, and SDK installation.
Best,
Ahmed I.
1- Activate Command-line Tools and download it as in this picture
2- Add Android SDK path to your system environment variables.
this link would help you..
Related
I already have Android Studio installed and tried installing Flutter. After following the instructions, I have encountered a problem. When I run
flutter doctor -v
It returns
[√] Flutter (Channel stable, 1.22.0, on Microsoft Windows [Version 10.0.18363.1082], locale en-PH)
• Flutter version 1.22.0 at C:\src\flutter
• Framework revision d408d302e2 (3 days ago), 2020-09-29 11:49:17 -0700
• Engine revision 5babba6c4d
• Dart version 2.10.0
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
• Android SDK at C:\Users\%User%\AppData\Local\Android\sdk
• Platform android-30, build-tools 30.0.2
X Android SDK file not found:C:\Users\%User%\AppData\Local\Android\sdk\build-tools\30.0.2\aapt.
• Try re-installing or updating your Android SDK,
visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions.
[√] Android Studio (version 4.0)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 50.0.1
• Dart plugin version 193.7547
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
[√] VS Code, 64-bit edition (version 1.48.2)
• VS Code at C:\Program Files\Microsoft VS Code
• Flutter extension version 3.14.1
[!] Connected device
! No devices available
! Doctor found issues in 2 categories.
I tried connecting my device too and it didn't recognize, even after enabling USB debugging. I also tried reinstalling Android Studio. I think the issue lies with the missing 'aapt' since it's not on any folder when i manually looked for it but Android SDK file not found: C:\Users\%User%\AppData\Local\Android\sdk\build-tools\30.0.2\aapt tells me it should be there.
Thank you for the help!
try this...
open cmd or terminal and run below command
flutter config --android-sdk <path-to-your-android-sdk-path>
hope this will work
I had the same problem today :
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3) X Android SDK file not found: C:\Users\admin\AppData\Local\Android\Sdk\build-tools\30.0.3\aapt.
I fixed it by deleting the two most recent folders in C:\...\build-tools\ which do not contain aapt.exe -> 30.0.2 and 30.0.3 (This deleted folders only contained a folder named .installer).
This answer inspired me : https://stackoverflow.com/a/56995320/13170425
flutter config --android-sdk
run this command and run flutter doctor again this should help you
That's not a big deal. You install the Android SDK and 1 notice that the device is not connected only. You can install the android SDK from the link below:
https://developer.android.com/studio#downloads
I had the same issue
Android SDK file not found: C:\Users\Admin\AppData\Local\Android\Sdk\build-tools\31.0.0\aapt.
I had already tried other solutions but this worked for me . In SDK Manager , go to SDK tools , and check the checkbox "Show the various packages" and uncheck "Hide obsolete packages"
Now under Android SDK Build-tools 31 , install 31.0.0 and apply
Under Android SDK Command-line tools (latest), install Android SDK Command-line tools (obsolete)
This worked for me , hope it works for you too !
Reinstalling the sdk 30.0.2 from sdk manager in android studio(Tools->sdk tools->(tick show package details)) fixes the problem.
I had the same problem today. In my problem, can not find 32 aapt., I had try many:
flutter config --android-sdk [path]
uninstall 32 and install again
install low version like 31(30)
and so on
still not work until:
uninstall 32
remove folder 32 which need aapt.
On my device, flutter does not hot reload, I initially thought this was a problem with flutter or android studio or vs code but when I use a different device, the hot reload is working. How do I resolve this, it's just been driving me crazy and I have already spent a lot of hours trying to figure this out.
And btw, it was initially working on this device until it wasn't, and I have already restarted my phone, I have even reinstalled flutter, basically every suggestion from the internet I have tried but so far, no fruits.
Any help would be highly appreciated, here is the flutter doctor -v.
[✓] Flutter (Channel stable, v1.12.13+hotfix.9, on Linux, locale en_US.UTF-8)
• Flutter version 1.12.13+hotfix.9 at /home/hamisi/flutter
• Framework revision f139b11009 (5 weeks ago), 2020-03-30 13:57:30 -0700
• Engine revision af51afceb8
• Dart version 2.7.2
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at /home/hamisi/android
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.2
• ANDROID_HOME = /home/hamisi/android/
• Java binary at: /home/hamisi/android-studio/jre/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
• All Android licenses accepted.
[✓] Android Studio (version 3.5)
• Android Studio at /home/hamisi/android-studio
• Flutter plugin version 44.0.1
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
[✓] Connected device (1 available)
• LG H845 • LGH845e35cd375 • android-arm • Android 7.0 (API 24)
• No issues found!
The output from flutter run -v --trace-startup is https://pastebin.com/9X4S5LWr
I had this exact problem with a Pixel 2. Fine one minute, then boom - hot reload / restart was not available. I could deploy the app to the device, but hot reload options were greyed out in Android Studio and hot reload keyboard shortcuts did nothing. Pressing r after flutter run also did nothing. Nothing significant happened in between it working and it not working - no updates to Android Studio, Flutter or the device. I tried restarting the device, Android Studio, flutter clean, I tried swapping the USB cable, nothing seemed to work.
It did eventually start working again: I did a flutter clean followed immediately by a reboot of my computer. I have no idea if this was the fix, or whether it was just one of those random who-the-f-knows, but hopefully it will help anyone else.
[√] Flutter (Channel stable, v1.17.0, on Microsoft Windows [Version 10.0.18362.778], locale en-GB)
• Flutter version 1.17.0 at D:\flutter
• Framework revision e6b34c2b5c (10 days ago), 2020-05-02 11:39:18 -0700
• Engine revision 540786dd51
• Dart version 2.8.1
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at C:\Users\james\AppData\Local\Android\sdk
• 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)
• All Android licenses accepted.
[√] Android Studio (version 3.6)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 45.1.1
• Dart plugin version 192.7761
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
[√] Connected device (1 available)
• Pixel 2 • HT7C11A06689 • android-arm64 • Android 10 (API 29)
• No issues found!
I had this issue some days ago I did a couple of things:
In some files may be added file:/// before the file name in the above file. Search in the whole project and remove file:/// line and again import that package again.
flutter upgrade
Clean project(flutter clean)
I also change my emulator.
that worked for me
Since you have all necessary plugin installed and your flutter-doctor has no issues.
Try running the command flutter clean.
Hopefully that is going to work.
I hope this helps.
if you are using an android virtual device. navigate to its settings => proxy then untick 'Use android studio http proxy settings' select 'No proxy'... that worked for me.
For anyone else who runs into this issue and has installed VS Code Hotkeys/Keymap for Android Studio, the default VS Code hotkey for "Save All" will immediately stop hot reload from working. (With VS Code hotkeys this is Ctrl+K or S)
Simply removing the "Ctrl+K, S" and replacing it with Ctrl+S worked after days of trying to fix this. Screenshot below.
File -> Settings -> Keymap -> Search for "save"
Screenshot with Instructions (Settings -> Keymap)
HotReload was not working me as well, but I searched for it and found the solution.
When you click on the HotReload it will work only in the changes inside the Build() Widget, if your code is outside the build() widget then it will not work...
Thanks
I had the same problem, All you need to do:
Wipe data in the Android Emulator
Cold boot the device and done.
If you are still not able to figure it out check this method.
When you import widget from another .dart file. sometime android studio will import this path.
import file:///C:/kharag/.../.../< App Name >/lib/filename.dart
Hot reload and hot restart will not work in that case. To fix that you should find and remove file path and replace with given path format below
import package:< App Name >/filename.dart
Note: To see the change stop your app and run again
I use Android Studio as my IDE in coding Flutter. I was able to create 2 projects before this and it worked absolutely fine. I had to clone a repo from Github. The IDE said to get config. I did that then this happened.
I already installed sdk .
My android devices android version is 7.0
Flutter Doctor result:
[√] Flutter (Channel stable, v1.12.13+hotfix.8, on Microsoft Windows [Version 10.0.18363.720], locale en-US)
• Flutter version 1.12.13+hotfix.8 at C:\src\flutter\flutter
• Framework revision 0b8abb4724 (6 weeks ago), 2020-02-11 11:44:36 -0800
• Engine revision e1e6ced81d
• Dart version 2.7.0
[X] Android toolchain - develop for Android devices
X Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.dev/setup/#android-setup for detailed instructions).
If the Android SDK has been installed to a custom location, set ANDROID_HOME to that location.
You may also want to add it to your PATH environment variable.
[√] Android Studio (version 3.6)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 44.0.2
• Dart plugin version 192.7761
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
[!] Android Studio
• Android Studio at C:\Program
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
X android-studio-dir = C:\Program
X Android Studio not found at C:\Program
• Try updating or re-installing Android Studio.
• Consider removing your android-studio-dir setting by running:
flutter config --android-studio-dir=
[!] VS Code
• VS Code at C:\Users\Tamim Mostafa\AppData\Local\Programs\Microsoft VS Code
X Flutter extension not installed; install from
https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[!] Connected device
! No devices available
! Doctor found issues in 4 categories.
I also tried changing the directory an using folder with no white space. I moved the Sdk folder to D:\Android\Sdk. flutter doctor -v:
[√] Flutter (Channel stable, v1.12.13+hotfix.8, on Microsoft Windows [Version 10.0.18363.720], locale en-US)
• Flutter version 1.12.13+hotfix.8 at C:\src\flutter\flutter
• Framework revision 0b8abb4724 (6 weeks ago), 2020-02-11 11:44:36 -0800
• Engine revision e1e6ced81d
• Dart version 2.7.0
[X] Android toolchain - develop for Android devices
X ANDROID_HOME = D:\Android\Sdk
but Android SDK not found at this location.
[√] Android Studio (version 3.6)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 44.0.2
• Dart plugin version 192.7761
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
[!] Android Studio
• Android Studio at C:\Program
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
X android-studio-dir = C:\Program
X Android Studio not found at C:\Program
• Try updating or re-installing Android Studio.
• Consider removing your android-studio-dir setting by running:
flutter config --android-studio-dir=
[!] VS Code
• VS Code at C:\Users\Tamim Mostafa\AppData\Local\Programs\Microsoft VS Code
X Flutter extension not installed; install from
https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[!] Connected device
! No devices available
! Doctor found issues in 4 categories.
I've had the same issue and what worked for me is to re-import the project.
File > Close Project, go to the project's directory and delete the .idea folder.
Then File > Open... and re-open the project.
Open Project Structure, you can set the project's SDK with what you have.
After this, I was able to run main.dart with the emulator.
It solved my problem:
Make sure Flutter plugin is installed in android studio, you can install the plugin from file > setting > plugin
choose flutter SDK path from File > setting> Language & Framework > flutter.
It took me a while to find Project that the others are seeing, it's probably due to the updated version of Android Studio. I found it on External Libraries on the left panel and under it, right click on the Android API (NN) Platform > Open Library Settings > Project under Project Settings and on the right panel, change the Android API. I had <No SDK>, see screenshot.
This seems to be the problem:
[X] Android toolchain - develop for Android devices
-> ANDROID_HOME = D:\Android\Sdk but Android SDK not found at this location.
Since you said that you added the Android SDK to your D directory, you could just add D:\Android\sdk\tools and D:\Android\sdk\platform-tools to your PATH environment variable. This is how you can add it to your Path enviroment variable: https://docs.telerik.com/teststudio/features/test-runners/add-path-environment-variables
It seems like this problem may have a lot of different symptoms, but for me to be able to run my flutter app in my android device, I had to set the android SDK in the Project Structure modal.
You can open the Project Structure modal by right clicking on the project root folder (in the file tree) > Module Settings > Project and set the Project SDK:
Mine is like this:
If somehow the Project tab is disabled or in a weird state, I recommend you to close android studio, delete the project .iml file and the .idea folder, reopen the project in AS (open existing project) and set the android SDK in the project structure like I've described above. At least this is what I did and it fixed for me, so I hope this answer help someone.
Go to Tools > SDK Manager > SDK Tools and check Google USB Driver. Restart Android Studio.
All this worked for me, might be helpful to someone.
All you need is to run Android Studio as Administrator.
Thats warning said "Android SDK location should not contain whitespace". There is a whitespace character in Tamim Mustofa.
You can move sdk folder to new folder like D:\Android\Sdk, where there is no space or other whitespace character in the path.
Change Android Sdk Location address in Android Studio.
and add variabel ANDROID_HOME in your Environment Variable: System Variable. with D:\Android\Sdk as variable value
Some SDK versions of Flutter may cause the problem of not being able to find the device or simulator.You can switch the SDK version to the stable version.
I had a same problem on my Mac with the Flutter version 1.17.4, and it worked after I went back the version to 1.17.3.
Version rollback step:
1.Open the Flutter GitHub repository.
2.Click 'master' button to open the switch menu. And the click 'Tags' item.
3.Search the stable version tag(e.g. 1.17.3).
4.Open the tag and click the commits.
5.Copy the top commit id.
6.Run the command 'git reset --hard $(commit id)' in the Flutter directory.
7.Restart the Android Studio.
File > Invalide caches/restart, work for me
If you are using macOS and the other answers did not work, try this
flutter config --enable-macos-desktop
For me, going to device manager in android studio and running the emulator, fixed it. Thus the emulator has to be running before you can select it to run the application on, which makes sense I guess...
In my case there was no package attribute in the android/app/src/main/AndroidManifest.xml file for the manifest tag. Adding it solved the problem:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="my.package.name">
OR
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="#applicationId">
type to terminal this below
flutter config --android-sdk ANDROID_SDK_PATH
Reading this page helped: by the time I reached the end of this page Android Studio had fully recognised my connected mobile phone (with developer mode enabled) and it was not longer greyed out in the Devices list.
All you need is Updating the android SDK then restart the IDE.
That's it.
This kind of problem I was facing so When I was done with Invalid caches/ restart then it automatically detect the main. dart and works fine.
Just give it a try with Invalid Caches/ Restart.
Check your Dart SDK and Flutter SDK path setup in the Environment variable setup and inside the setting of the android studio as well.
If it is ok then Do Invalid Caches/ Restart the project and Check.
It might be helped. !!!
I upgrade flutter from v1.91. hotfix 6 by using flutter upgrade --force.
Then i build an example "layers" - flutter run, it shows this message, while if i switch to 1.91, everything built ok
flutter run --stacktrace gives this error
Could not find an option named "stacktrace".
flutter doctor -v
G:\new\new_exam>flutter doctor -v [√] Flutter (Channel stable,
v1.12.13+hotfix.5, on Microsoft Windows [Version 10.0.18362.535],
locale en-US) • Flutter version 1.12.13+hotfix.5 at G:\Flutter\flutter
• Framework revision 27321eb (12 days ago), 2019-12-10 18:15:01 -0800
• Engine revision 2994f7e1e6 • Dart version 2.7.0
[√] Android toolchain - develop for Android devices (Android SDK
version 29.0.2) • Android SDK at G:\Flutter\android • Android NDK
location not configured (optional; useful for native profiling
support) • Platform android-29, build-tools 29.0.2 • ANDROID_HOME =
G:\Flutter\android • ANDROID_SDK_ROOT = G:\Flutter\android\sdk • Java
binary at: G:\flutter\openjdk\bin\java • Java version OpenJDK Runtime
Environment (build 1.8.0_232-b09) • All Android licenses accepted.
[!] Android Studio (not installed) • Android Studio not found;
download from https://developer.android.com/studio/index.html (or
visit https://flutter.dev/setup/#android-setup for detailed
instructions).
[!] IntelliJ IDEA Community Edition (version 2019.3) • IntelliJ at
C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2019.3.1 X
Flutter plugin not installed; this adds Flutter specific
functionality. X Dart plugin not installed; this adds Dart specific
functionality. • For information about installing plugins, see
https://flutter.dev/intellij-setup/#installing-the-plugins
[!] Connected device ! No devices available
! Doctor found issues in 3 categories.
1: https://i.stack.imgur.com/B4DTX.png
I feel the solution is pretty straight forward. Usually, it's always a best practice to use Android Studio when working with Flutter and Dart. Reasons are there are some dependencies that would require you to use Android Studio to have it work well for you, especially when you're just starting to work with Flutter and Dart.
Flutter Doctor is pretty precise as to the issues you're experiencing.
After downloading Android Studio, do the following;
Navigate to your Preferences or Android Studio Settings on PC, then select, Plugins, ensure the following plugins are installed.
Android APK Support
Android NDK Support
Dart
Flutter
EditorConfig
App Links Assistant
Google Services
Gradle
Properties Support
Java Bytecode Decompiler
Java Stream Debugger
Task Management
YAML
Among others which would be automatically installed by Android Studio for you, this should take that error away and you should be fine.
Then, before you probably run your App, if you see the get dependencies at the Top of your Android Studio, click the get dependencies so that Android studio can get the latest dependencies to run your App without issues.
Ensure you run a cold restart after each time you add a new dependency to your pubspec.yaml file.
my flutter doctor -v result:
[√] Flutter (Channel stable, v1.0.0, on Microsoft Windows [Version 10.0.17134.472], locale fa-IR)
• Flutter version 1.0.0 at C:\Android\flutter
• Framework revision 5391447fae (6 weeks ago), 2018-11-29 19:41:26 -0800
• Engine revision 7375a0f414
• Dart version 2.1.0 (build 2.1.0-dev.9.4 f9ebf21297)
[!] Android toolchain - develop for Android devices (Android SDK 27.0.3)
• Android SDK at c:\Android\android-sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 27.0.3
• ANDROID_HOME = C:\Android\android-sdk
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)
X Android license status unknown.
[√] Android Studio (version 3.1)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 29.0.1
• Dart plugin version 173.4700
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)
[√] Connected device (1 available)
• HUAWEI CUN U29 • CCMBBCB6C0153603 • android-arm • Android 5.1 (API 22)
and when run:
flutter doctor --android-licenses
get me this result:
A newer version of the Android SDK is required. To update, run:
c:\Android\android-sdk\tools\bin\sdkmanager --update
and when update sdkmanager show this error to me:
Exception in thread "main" java.lang.NoSuchFieldError: FN_AAPT2
at com.android.sdklib.BuildToolInfo.<init>(BuildToolInfo.java:362)
How can i solve this challenge?
I solved this problem by installing the command line tool.
And then rerun
flutter doctor --android-licenses
I have followed these steps. It worked for me.
went to Environment variables and added ANDROID_HOME with a variable value of:
C:\Users\%username%\AppData\Local\Android\Sdk
then my JAVA_HOME with this variable value:
C:\Program Files\Android\Android Studio\jre
then my Path with this variable value:
C:\Users\%username%\flutter\bin
then I ran the following command
flutter doctor
Got the output of Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel beta, v0.2.3, on Microsoft Windows [Version 10.0.16299.309],
locale en-US)
[!] Android toolchain - develop for Android devices (Android SDK 27.0.3)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --
android-licenses
[√] Android Studio (version 3.1)
[√] Connected devices (1 available)
! Doctor found issues in 1 category.
Then I ran
flutter doctor --android-licenses
and accepted all Terms & Conditions with (y)
Install Android SDK Command-line Tools on android studio using the SDK manager
Run flutter doctor --android-licenses
Now this problem with the license has got to do with the java development kit(JDK) version.
For some reasons if you are not using JDK 8 or below, you will unfortunately get license issues.So basically uninstall current version and install JDK 8 or below. Check link below and follow the conversation carefully.
https://github.com/flutter/flutter/issues/16025
I solved pb (jdk11 on Win10 at beginning) following Nitesh steps (thanks) but with some change due to win10 strange behavior ( i know...).
To objectify, create two environment'variables with win10 wizards :
I strike :
TEST1 C:\Users\%username%\XXX
TEST2 %USERPROFILE%\YYY
Appear correct in wizard:
TEST1 C:\Users\pirla\XXX
TEST2 C:\Users\pirla\YYY
But in a dos command window, this comes to SYSTEM in first case despite correct username :
C:\Users\pirla>echo %username%
pirla
C:\Users\pirla>set TEST
TEST1=C:\Users\SYSTEM\XXX
TEST2=C:\Users\pirla\YYYY
So replace
C:\Users\%username%\
by
%USERPROFILE%\
and averything is ok.
( by the way, if you have also an JRE_HOME , change it too )
HTH
There is an SDK Manager Icon in the top right of Android Studio between the AVD manager icon and the magnifying glass. Click it.
You get a modal that shows you are in System Settings -> Android SDK n the left menu. In the middle area there is an SDK Tools tab so click it.
Check off the box that says "Android SDK Command-line Tools (latest)" and click Apply. It will install it (about 105M). Now run flutter doctor --android-licenses and say yes to everything. The error should be gone.
Use flutter_console instead of CMD
flutter doctor --android-licenses
This worked for me:
open Android Studio's SDK Manager
go to the Android SDK tab
under SDK Tools, uncheck Hide Obsolete Packages
install Android SDK Tools (Obsolete)
SOLUTION: None of the above works when setting up a Windows 10 Flutter 1.17.1 environment for mobile development. The quickest and easiest solve is to download android-studio-ide-193.6514223-windows (Android 4.0) from https://developer.android.com/studio/archive.
Download Android 4.0
Install Command
Line Tools in SDK Settings
Reboot Open Command Prompt
flutter doctor -v
You must install Android SDK Command-line Tool(Latest).
Go to SDK Manager in android studio, in tab SDK Tools, check in Android SDK Command-line Tool(Latest) and then click "apply".
On Windows:
open cmd and run:
android update sdk
After that run flutter doctor again
in terminal :
flutter update
flutter doctor --android-licenses
accept all terms by y
Uninstall Android Studio or the Android SDK. Reinstall it.