GitHub user breautek added a comment to the discussion: Android target: not 
installed

> 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:641)
        at 
java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
        ... 5 more

This usually indicates that you have the legacy android tools installed.

You can uninstall them by removing the `Android SDK Tools (Obsolete)`:

![Screenshot from 2024-05-08 
22-57-41](https://github.com/apache/cordova/assets/11200662/7089f33f-92f2-4292-ad48-892f1c101677)

Note that `Hide Obsolete Packages` must be unchecked to see the obsolete 
packages. The obsolete package is intended to be used with JDK 8. It doesn't 
support higher JDK installations.

While you're there, I'd recommend going against the documentations and install 
Command-line tools version 11. Alternatively upgrade your JDK to 17. The latest 
command line tools requires JDK 17.

Lastly a "working" printout will produce something like:

```
Requirements check results for android:
Java JDK: installed 17.0.9
Android SDK: installed true
Android target: not installed 
Command failed with ENOENT: avdmanager list target
spawn avdmanager ENOENT
Gradle: installed /development/tools/gradle-8.7/bin/gradle
Some of requirements check failed
```

While android target and avdmanager doesn't appear to work in requirements, it 
shouldn't prevent you from building and running your cordova project.

GitHub link: 
https://github.com/apache/cordova/discussions/475#discussioncomment-9362272

----
This is an automatically sent email for issues@cordova.apache.org.
To unsubscribe, please send an email to: issues-unsubscr...@cordova.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org

Reply via email to