flutter doctor --android-licenses报错解决方案

C:\Users\32148>flutter doctor --android-licenses
Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!
����: �������� com.android.sdklib.tool.sdkmanager.SdkManagerCli ʱ���� LinkageError
        java.lang.UnsupportedClassVersionError: com/android/sdklib/tool/sdkmanager/SdkManagerCli has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0
Android sdkmanager tool was found, but failed to run
(C:\Users\32148\AppData\Local\Android\Sdk\cmdline-tools\latest\bin\sdkmanager.bat): "exited code 1".
Try re-installing or updating your Android SDK,
visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions.

解决方案:

安装jdk17,若还不行,按以下步骤行动

Windows 

flutter doctor --android-licenses报错解决方案_第1张图片

  1. 取消勾选and sdk command line tools (latest)
  2. 勾选 Android SDK command-line Tools 8.0
  3. 点击应用
  4. 在Windows, 将 “C:\Users\USERNAME\AppData\Local\Android\Sdk\cmdline-tools” and 重命名 8.0 folder to “latest”
  5. 再次运行 Flutter doctor.

 成功!

flutter doctor --android-licenses报错解决方案_第2张图片

你可能感兴趣的:(flutter,android)