Android Studio (version 2022.2) Unable to find bundled Java version.

PS C:\Windows\system32> flutter doctor
Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source!
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.10.5, on Microsoft Windows [Version 10.0.19044.1566], locale zh-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
[✓] Chrome - develop for the web
[!] Android Studio (version 2022.2)
    ✗ Unable to find bundled Java version.
[✓] VS Code (version 1.77.1)
[✓] Connected device (3 available)

错误原因:电脑安装了多个版本的 Android Studio,而与 flutter 关联的版本可能因为文件不完整,导致关联失败。

打开目录: C:\Program Files\Android\Android Studio\

  1. 删除 jre 文件夹
  2. 复制 jbr 文件夹
  3. jbr-副本 更改为 jre

flutter doctor -v 可以查看详情