Android Question Installation/Upgrade to 10.2 Errors

swabygw

Active Member
Licensed User
Longtime User
SDK Manager
Error: Error: Could not find or load main class com.android.sdklib.tool.sdkmanager.SdkManagerCli
Caused by: java.lang.ClassNotFoundException: com.android.sdklib.tool.sdkmanager.SdkManagerCli

AVD Manager:
Error: Error: Could not find or load main class com.android.sdklib.tool.AvdManagerCli
Caused by: java.lang.ClassNotFoundException: com.android.sdklib.tool.AvdManagerCli

I think that this error has been mentioned before, but I think my installation steps were correct. Here's what I did to accomplish the upgrade from 10.0 to 10.2.

1) Keeping existing Java, so downloaded everything in #2 and #3 here (B4A – The simple way to develop native Android apps (b4x.com)) the Android command_line_tools, the resources_9_20, the new B4A Full Version. Existing Java installation look like this:
1608415571431.png

2) Deleted my existing Android folder. Recreated a new Android folder and extracted command_line_tools and resources_9_20 into it, and it looks exactly as suggested (see image below).

1608415068191.png

3) Installed B4A and double-checked Configure Paths. It looks like this:
1608415141872.png
I had seen that 29 is the recommended version, should I go ahead and change this to 29? To check if I could download 29, I went on to the next step.

4) I'm planning on using the emulator, so I opened the SDK Manager to see what was installed and go the error mentioned above.
Error: Error: Could not find or load main class com.android.sdklib.tool.sdkmanager.SdkManagerCli
Caused by: java.lang.ClassNotFoundException: com.android.sdklib.tool.sdkmanager.SdkManagerCli

5) Clicking on the AVD Manager button within the SDK Manager popup yields the following error, too:
Error: Error: Could not find or load main class com.android.sdklib.tool.AvdManagerCli
Caused by: java.lang.ClassNotFoundException: com.android.sdklib.tool.AvdManagerCli
 

MikeSW17

Active Member
Licensed User
Longtime User
1) Did you follow these Installation Instructions exactly? There is no need to invent a 'new' way, and every chance of it going wrong if you do!
2) You MUST avoid using built-in Windows extract to unpack any/all ZIPs. Use 7-Zip. Windows extract has been proven to corrupt the folder structures.

From your 'Not Found' Errors, I strongly expect you have the ZIP extract problem.
 
Upvote 0

swabygw

Active Member
Licensed User
Longtime User
Doing the extraction with 7-Zip solved it. Thanks! (I read the "such as 7-Zip" in the instructions to mean it was just a suggested alternative)
 
Upvote 0

MikeSW17

Active Member
Licensed User
Longtime User
Doing the extraction with 7-Zip solved it. Thanks! (I read the "such as 7-Zip" in the instructions to mean it was just a suggested alternative)
Yes, It would be good if @Erel clarified those instructions.
After having very similar problems to yourself, I came across 'hints' that ZIP handling isn't correctly implemented in Windows. I didn't really believe it, so made two parallel extract folders with 7-Wip & windows, then compared them with Winmerge. I found windows extracted several files into spurious "_" folders as sub-folders of where they should be. Details Here: https://www.b4x.com/android/forum/attachments/zipextractdiff_commandline-tools-jpg.100632/
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
You MUST avoid using built-in Windows extract to unpack any/all ZIPs. Use 7-Zip. Windows extract has been proven to corrupt the folder structures.
I don't think that it is always true. Maybe it depends on the Windows version. I believe that with Windows 10 the built-in extraction works properly.
 
Upvote 0

Albert Kallal

Active Member
Licensed User
I also found this issue - had to use 7-zip - windows zip worked for the B4A install + setup.
However, but for the emulator - it did not work.
Re-extracting with 7-zip also fixed this for me.

I used Edge browser (but is now chrome based one) to download.

R
Albert
 
Upvote 0
Top