flutter doctor
gives the following error:
Checking Android licenses is taking an unexpectedly long time...[☠] Android toolchain - develop for Android devices (the doctor check crashed) ✗ Due to an error, the doctor check did not complete. If the error message below is not helpful, please let us know about this issue at https://github.com/flutter/flutter/issues. ✗ Exception: Android toolchain - develop for Android devices exceeded maximum allowed duration of 0:10:00.000000
I have installed the latest Android SDK Command-line Tools in Android Studio
I have tried setting the location of SDK via flutter config –android-sdk /Users/mooreihu/Library/Android/sdk
I have tried running flutter doctor –android-licenses, and it hangs indefinitely. I never reached a timeout or anything like that.
I am not sure what else to try, haven’t found much on this specific issue online. Thank you for any help!
Here is my complete flutter doctor -v output:
[✓] Flutter (Channel stable, 3.3.1, on macOS 12.5.1 21G83 darwin-arm, locale en-US)
• Flutter version 3.3.1 on channel stable at /Users/mooreihu/Downloads/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 4f9d92fbbd (8 days ago), 2022-09-06 17:54:53 -0700
• Engine revision 3efdf03e73
• Dart version 2.18.0
• DevTools version 2.15.0
Checking Android licenses is taking an unexpectedly long time...[☠] Android toolchain - develop for Android devices (the doctor check crashed)
✗ Due to an error, the doctor check did not complete. If the error message below is not helpful, please
let us know about this issue at https://github.com/flutter/flutter/issues.
✗ Exception: Android toolchain - develop for Android devices exceeded maximum allowed duration of
0:10:00.000000
•
[✓] Xcode - develop for iOS and macOS (Xcode 14.0)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 14A309
• CocoaPods version 1.11.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2021.2)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
[✓] IntelliJ IDEA Ultimate Edition (version 2022.1.3)
• IntelliJ at /Applications/IntelliJ IDEA.app
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
[✓] IntelliJ IDEA Community Edition (version 2022.1.3)
• IntelliJ at /Users/mooreihu/Library/Application
Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/221.5921.22/IntelliJ IDEA CE.app
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
[✓] VS Code (version 1.69.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension can be installed from:
🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[✓] Connected device (2 available)
• macOS (desktop) • macos • darwin-arm64 • macOS 12.5.1 21G83 darwin-arm
• Chrome (web) • chrome • web-javascript • Google Chrome 105.0.5195.102
[✓] HTTP Host Availability
• All required HTTP hosts are available
! Doctor found issues in 1 category.
2
Answers
The solution to this was to used Java 8 instead of Java 11
You have to install Java 8 instead of your actual version of Java and reboot the computer!!