ankidroid / Anki-Android-Backend

JNI bridge between AnkiDroid and Anki Desktop's rust code
GNU General Public License v3.0
69 stars 27 forks source link

macos_install.yml: Fix "Install NDK" step #16

Closed david-allison closed 3 years ago

david-allison commented 3 years ago

We currently use the preinstalled NDK to get around this.

An install currently returns the following error.

Appears to be due to removed Java EE libraries in later versions of Java.

Steps on: https://stackoverflow.com/questions/46402772/failed-to-install-android-sdk-java-lang-noclassdeffounderror-javax-xml-bind-a did not resolve the issue.

java -version and javac -version return 1.8.0_275

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.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:73)
    at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:602)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
    ... 5 more
david-allison commented 3 years ago

Done via:

https://github.com/david-allison-1/Anki-Android-Backend/blob/37fda3c999261b228e5712b8d52e28a0346a71dc/.github/scripts/install_ndk_macos.sh#L1-L8