Flutter:异常:Android工具链-为Android设备开发超过了允许的最大持续时间0:10:00.000000



flutter doctor给出以下错误:

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

我已经在Android Studio 中安装了最新的Android SDK命令行工具

我尝试过通过flutter配置设置SDK的位置——android-SDK/Users/mooreihu/Library/android/SDK

我试过运行flutter医生——安卓许可证,但它无限期地挂起。我从来没有达到过暂停或类似的时间。

我不知道还能尝试什么,也没有在网上找到太多关于这个特定问题的信息。谢谢你的帮助!

这是我完整的扑动医生-v输出:

[✓] 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.

解决方案是使用Java 8而不是Java 11

您必须安装Java 8而不是实际版本的Java,然后重新启动计算机!!

最新更新