Closed eronnen closed 1 year ago
apparently can be fixed with the androidTargetSdkVersion
parameter and ANDROID_SDK_MANAGER_PARAMETERS
environment variable, but the sdkmanager invocation fails with:
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
at com.***.repository.api.SchemaModule$SchemaModuleVersion.<init>(SchemaModule.java:156)
at com.***.repository.api.SchemaModule.<init>(SchemaModule.java:75)
at com.***.sdklib.repository.AndroidSdkHandler.<clinit>(AndroidSdkHandler.java:81)
at com.***.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:73)
at com.***.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:581)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
... 5 more
Context
I try to build android APK on Unity 2022, with API 29 target. By default the android sdk that is shipped with unity comes with 30 and 31 target sdk, so I get the following error:
Suggested solution
add a parameter to the build that will install the target sdk with: