I’m new to ionic framework and have been trying to create my first hybrid application. By following some tutorials online, somehow, i managed to create my first application. Now, I’m trying to create apk for android devices but when i run ionic cordova run android --prod --release, it gives me error as requirements check failed for jdk 1.8 or greater. Please note that I’ve installed jdk 9.0 ( which is latest, i guess.).
@Sujan12 , By running ionic cordova requirements command, I’m getting following results
Requirements check results for android:
Java JDK: installed
Android SDK: installed true
Android target: not installed
avdmanager: Command failed with exit code 1 Error output:
Exception in thread “main” java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
at com.android.repository.api.SchemaModule$SchemaModuleVersion.(SchemaModule.java:156)
at com.android.repository.api.SchemaModule.(SchemaModule.java:75)
at com.android.sdklib.repository.AndroidSdkHandler.(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:582)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:185)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:496)
… 5 more
Hi all. OK, so I’ve been through this pain. I’d like to think of myself as quite tech savvy. I’m more than at home in the console than I am in the GUI. But (and I know I’m gonna rub some people up the wrong way here) Java is a real PITA. Anyhoo, I’m straying from the subject a little, so back on point…
By far, the easiest solution is to install Android studio. It will download everything you need (even if like me you never open the UI). The right Java, set the paths, etc, the SDK’s and even the emulators. Hit this up to take care of your Mac-Android woes