I have been installing the needed components to build Android apps with Cordova on my Mac (OS 13.4.1). I am now at a point where the results of my cordova requirements query is:
Requirements check results for android:
Java JDK: installed 11.0.21
Android SDK: installed true
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: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
Gradle: installed /usr/local/Cellar/gradle/8.5/bin/gradle
Requirements check results for browser:
Some of requirements check failed
I have tried uninstalling, reinstalling, killing processes, and a few other methods I've found online, but my Android Studio install seems to be missing something? Not only am I getting this error above, but when I attempt to open the Android Studio I have installed, I receive this IDE Already Running error:
Cannot connect to already running IDE instance.
CannotActivateException: /Users/tomadkins/Library/Application Support/Google/AndroidStudio2023.1
The directory above (/Users/tomadkins/Library/Application Support/Google/AndroidStudio2023.1) does not exist on my machine.
I have tried uninstalling, reinstalling, killing processes, and a few other methods I’ve found online.
2
Answers
You do not have the target Android SDK installed. Go to your Android Studio app then install the appropriate SDK
In my case, the owner of
~/Library/Application Support/Google
wasroot
.try
sudo chown tomadkins ~/Library/Application Support/Google