Bubblewrap CLI error: Could not find or load main class com.android.sdklib.tool.sdkmanager.SdkManagerCli

Bubblewrap CLI error: Could not find or load main class com.android.sdklib.tool.sdkmanager.SdkManagerCli

在使用 bubblewrap 构建我的应用程序时,我一直收到这个烦人的错误,它不允许我继续,因为安装 Android SDK 工具时出现问题:

C:\Users\Me\Desktop\app>bubblewrap build
,-----.        ,--.  ,--.  ,--.
|  |) /_,--.,--|  |-.|  |-.|  |,---.,--.   ,--,--.--.,--,--.,---.
|  .-.  |  ||  | .-. | .-. |  | .-. |  |.'.|  |  .--' ,-.  | .-. |
|  '--' '  ''  | `-' | `-' |  \   --|   .'.   |  |  \ '-'  | '-' '
`------' `----' `---' `---'`--'`----'--'   '--`--'   `--`--|  |-'
                                                           `--'
Installing Android Build Tools. Please, read and accept the license agreement
build Installing Build Tools
Error: Could not find or load main class com.android.sdklib.tool.sdkmanager.SdkManagerCli


cli ERROR undefined

C:/Users/Me/.bubblewrap.bubblewrap 目录的结构:

.bubblewrap/
┣ cmdline-tools/
┃ ┗ tools/
┣ openjdk/
┃ ┣ bin/
┃ ┣ include/
┃ ┣ jre/
┃ ┣ lib/
┃ ┣ sample/
┃ ┣ ASSEMBLY_EXCEPTION
┃ ┣ LICENSE
┃ ┣ release
┃ ┣ src.zip
┃ ┗ THIRD_PARTY_README
┗ config.json

以及.bubblewrap中config.json的内容:

{
    "jdkPath": "C:/Users/Me/.bubblewrap/openjdk",
    "androidSdkPath": "C:/Users/Me/.bubblewrap/cmdline-tools"
}

更多信息:

注意: 前一段时间我问过 this question here,但我在其他地方找到了解决方案。

找了好久,终于找到了解决办法:

我通过安装早期版本的 Android SDK 工具解决了这个问题,正如@krayanni 在 this post 中从不同的 repo 所建议的那样。

I think latest version '6200805' has some issue, even I got the same problem.

Solution: Use the older sdkmanager version, please find below links for older version.

Windows no installer: https://dl.google.com/android/repository/sdk-tools-windows-4333796.zip

MacOSX: https://dl.google.com/android/repository/sdk-tools-darwin-4333796.zip

Linux: https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip

但是,显然,如果您使用 7zip 而不是默认的 windows 提取器解压缩文件,它应该可以正常工作。不过我还没试过。

more info here