flutter - 如何在运行 --android-licenses 后更正此错误“错误:无法找到或加载主类”
问题描述
运行后我一直收到此错误flutter doctor --android-licenses
我安装了所有 sdk 工具也我运行了flutter clean
并且flutter build
我将 sdk 平台路径添加到 env 变量
这是我的flutter doctor --android-licenses
输出:
Error: Could not find or load main class USERNAME\AppData\Local\Android\Sdk\cmdline-tools\latest\bin\\..
这是我的flutter doctor -v
输出:
[√] Flutter (Channel master, 2.3.0-17.0.pre.47, on Microsoft Windows [Version
10.0.19041.985], locale en-CA)
• Flutter version 2.3.0-17.0.pre.47 at C:\src\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision fdb1fb184d (6 days ago), 2021-05-24 22:04:02 -0700
• Engine revision b1385c0df1
• Dart version 2.14.0 (build 2.14.0-145.0.dev)
[!] Android toolchain - develop for Android devices (Android SDK version 31.0.0-rc4)
• Android SDK at C:\Users\USERNAME\AppData\Local\Android\Sdk
• Platform android-30, build-tools 31.0.0-rc4
• ANDROID_HOME = C:\Users\houda bouhsiss\AppData\Local\Android\Sdk
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6842174)
X Android license status unknown.
Run `flutter doctor --android-licenses` to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/windows#android-setup for more
details.
[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[√] Android Studio (version 4.2.0)
• Android Studio at C:\Program Files\Android\Android Studio
• 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.8+10-b944.6842174)
[√] Connected device (2 available)
• Chrome (web) • chrome • web-javascript • Google Chrome 90.0.4430.212
• Edge (web) • edge • web-javascript • Microsoft Edge 90.0.818.66
! Doctor found issues in 1 category.
解决方案
推荐阅读
- python - 使用'splinter'在python中保存测试失败的屏幕截图
- ssas-tabular - ssas 表格模型使用角色,因此客户只能看到使用的供应商
- vb.net - 使用单引号或双引号设置字符串格式
- .net-core - 在 Swagger 中为 Ocelot 请求 URL 错误,例如 http://http://
- javascript - 是的 - 在错误消息中输出一个字段值
- c# - 在 Google Sheets API 中处理工作表更改
- bash - 如何修复 Git am 错误“.git/rebase-apply 仍然存在但 mbox 给定”?
- jwt - 用一种编程语言生成的 JWT 可以被另一种编程语言使用吗?
- docker - 使用 Docker-compose 时 VM 实例 google cloud nuget 依赖错误
- r - missing() 和 is.null() 之间的范围差异