I am trying to run Image Asset Studio from the Android SDK and am encountering an error I cannot solve.
To give a little bit of background, I am presently limited by an ageing laptop (AMD A4-5000, 8 GB RAM, 1 TB hybrid disk [256 MB? SSD]) and, whilst I don't really have any major issue with Android Studio IDE, I find it very bloated and eats up my CPU time and memory. Visual Studio Code on the other hand, suits my cross-platform developing needs almost perfectly, is lightweight and with a plethora of extensions covering all I have needed thus far.
I am attempting to simply execute the Image Asset Studio .jar file from the command line and am encountering a Class Not Found error that suggests my paths might not be configured correctly, but as far as I can tell, all is well... all the other tools I have used have all worked as expected, but this is the first time I have tried to use one of the JAR applets from the /lib/ directory.
I have the latest (AFAIK) Android SDK command-line tools installed in my home directory, and I am trying to launch the Image Asset Studio from the command line. Two examples I have tried are:
~/android/tools/lib$ java asset-studio-26.0.0-dev.jar
~/$ java ./android/tools/lib/asset-studio-26.0.0-dev.jar
These give me the following error, or variations thereof:
Error: Could not find or load main class android.tools.lib.asset-studio-26.0.0-dev.jar
Error: Could not find or load main class asset-studio-26.0.0-dev.jar
Also, I have tried with the -jar flag:
~$ java -jar ~/android/tools/lib/asset-studio-26.0.0-dev.jar
no main manifest attribute, in /home/noscere/android/tools/lib/asset-studio-26.0.0-dev.jar
Different error, same effect :-)
I was previously getting a different error, which related to the wrong Java JRE being executed (I have 11 installed as well as the required 8 - solved with a quick sudo update-alternatives --config java
). Here is my current Java version:
~/android$ java -version
openjdk version "1.8.0_342" OpenJDK Runtime Environment (build 1.8.0_342-8u342-b07-0ubuntu1~20.04-b07)
OpenJDK 64-Bit Server VM (build 25.342-b07, mixed mode)
For reference, sdkmanager --version gives an output of 7.0 - if that helps identify my SDK version.
Is it possible to be successful in running any of the SDK Java apps from outside of the Studio IDE? All the other command line tools (sdkmanager, avdmanager, adb, etc.) are all working seamlessly thus far. In fact, I've not encountered any issue with my Visual Studio Code + SDK command-line tools development environment (well, that hasn't quick-fixable), until now...
My environment variables relating to the Android SDK are as follows (and all correct):
export ANDROID_HOME=$HOME/android
export PATH=$ANDROID_HOME/cmdline-tools/tools/bin:$PATH
export PATH=$ANDROID_HOME/emulator:$PATH
export PATH=$ANDROID_HOME/platform-tools:$PATH
export REPO_OS_OVERRIDE="Linux"
I'm stumped. Google-searching has thus far been fruitless. I'm loathe to install Android Studio IDE just for this, when I have successfully developed several apps over the years without needing it. I'm loathe to admit defeat.