简体   繁体   English

flutter 医生 --android-licenses 错误,如何解决?

[英]flutter doctor --android-licenses Error, how to fix this?

Error: Could not find or load main class M\AppData\Local\Android\Sdk\cmdline-tools\latest\bin\.. Caused by: java.lang.ClassNotFoundException: M\AppData\Local\Android\Sdk\cmdline-tools\latest\bin\错误:无法找到或加载主 class M\AppData\Local\Android\Sdk\cmdline-tools\latest\bin\.. 原因:java.lang.ClassNotFoundException: M\AppData\Local\Android\Sdk\cmdline-工具\最新\bin\

1

How to fix this issue?如何解决这个问题?

On macbook big sur with m1 chip this work for me:在带有 m1 芯片的 macbook big sur 上,这对我有用:

  • Run android studio.运行 android 工作室。
  • Select configure and click on sdk manager. Select 配置并单击 sdk 管理器。
  • Find the "SDK tools" option on android sdk menu.在 android sdk 菜单上找到“SDK 工具”选项。
  • select and install android SDK commant tools (or "Android SDK (obsolete) founded in other tutorial)" select 并安装 android SDK commant 工具(或“Android ZF20E3C5E54C0AB3D3765Dobste”中的其他教程)
  • try run flutter doctor... again尝试再次运行 flutter 医生...

I hope this work for you:)我希望这对你有用:)

You have not installed Android Studio yet, so install Android Studio, and create a new Android emulator.您还没有安装 Android Studio,所以安装 Android Studio,并创建一个新的 Android 模拟器。 If not, your Java SDK version might be the problem.如果没有,您的 Java SDK 版本可能是问题所在。 Download JAVA SE 8 from here .这里下载 JAVA SE 8。

  • Uninstall any previously installed JDKs and install this anew.卸载任何以前安装的 JDK 并重新安装。

  • Copy path of \bin of the JDK.复制 JDK 的\bin路径。

  • Open Environment Variables in your PC.在您的 PC 中打开环境变量。

  • Add a new variable JAVA_HOME with the copied value.使用复制的值添加一个新变量JAVA_HOME

JAVA_HOME

  • Now retry flutter doctor .现在重试flutter doctor

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM