androidandroid-sdk-toolsbubblewrap

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


When building my app with bubblewrap, I kept getting this annoying error wouldn't let me continue because there was a problem installing Android SDK tools:

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

Structure of the .bubblewrap directory in C:/Users/Me/.bubblewrap:

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

And the content of config.json within .bubblewrap:

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

More info:

Note: I asked this question here, a while back, but I found a solution elsewhere.


Solution

  • It took a great deal of searching, but I finally found a solution:

    I solved the problem by installing an earlier version of Android SDK tools as suggested by @krayanni in this post from a different 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

    However, apparently if you unzip the files with 7zip instead of the default windows extractor, it should work fine. I haven't tried this though.

    more info here