breautek commented on issue #1554:
URL:
https://github.com/apache/cordova-android/issues/1554#issuecomment-1418286705
I can't really answer for third-party CLI tools, I don't use them.
```
**Command failed with exit code 1: avdmanager list target**
Exception in thread "main" java.lang.NoClassDefFoundError:
javax/xml/bind/annotation/XmlSchema
at
com.android.repository.api.SchemaModule$SchemaModuleVersion.<init>(SchemaModule.java:156)
at
com.android.repository.api.SchemaModule.<init>(SchemaModule.java:75)
at
com.android.sdklib.repository.AndroidSdkHandler.<clinit>(AndroidSdkHandler.java:81)
at com.android.sdklib.tool.AvdManagerCli.run(AvdManagerCli.java:213)
at com.android.sdklib.tool.AvdManagerCli.main(AvdManagerCli.java:200)
Caused by: java.lang.ClassNotFoundException:
javax.xml.bind.annotation.XmlSchema
at
java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
at
java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 5 more
```
I'm fairly certain this is the error you get if you mismatch Android SDK
tooling with java versions. The Android SDK includes two sets of the same
tools, once is for Java 8, the other is for Java 11.
The java 8 tooling I'm pretty sure is automatically bundled with the android
SDK under `$ANDROID_HOME/tools` / `$ANDROID_HOME/tools/bin`. So ensure these
paths are **not** in your `PATH` variable, as they will not work if you're
using Java 11.
Instead, using the SDK Manager, install the `cmdline-tools` package. I'm
using version 7.0 right now just fine. Then you can add
`$ANDROID_HOME/cmdline-tools/7.0/bin` to your `PATH`. These binaries are
compatible with Java 11. If you use a different version, make sure you adjust
your PATH as the version is in the path.
> **'sh' is not recognized as an internal or external command,**
I'm guessing it's trying to start the emulator and is attempting to run a sh
command on the emulator, but if the `avdmanager` binaries aren't working
because of the mismatch of java versions, it will fail. So this is probably a
side effect error of your first problem.
Lastly, I know you're using Windows, so my `$ANDROID_HOME/tools` examples
are not going to be identical as they are based on unix environments... I don't
develop on a windows machine, so I'm not very familiar with how they represent
things. I'm assuming that you have the know how to set up environment variables
on Windows. I think windows uses `%ANDROID_HOME%` for environment variables.
`$ANDROID_HOME` should be the path to the root android sdk folder.
> the <android-studio-root>/jre path does not contain anything but an empty
file named
Perhaps windows has a different folder structure. To be clear this is not
the Android SDK folder, but the Android Studio folder. But on Linux you
download Android Studio as one big tarball archive whereas on windows you get
an actual installer, so the structure could be very different.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]