Reputation: 48
I used cordova requirements to check to see if I can build for Android. It crashed with an exit code 1 and it says that my Android target is not installed.
Here is my output:
cordova requirements
Android Studio project detected
Requirements check results for android:
Java JDK: installed 1.8.0
Android SDK: installed true
Android target: not installed
cmd: 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.<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: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
Gradle: installed G:\Program Files\Android\gradle\gradle-4.1\bin\gradle
Requirements check results for browser:
(node:10036) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'forEach' of undefined
at C:\Users\jgols\AppData\Roaming\npm\node_modules\cordova\src\cli.js:397:35
at Array.map (<anonymous>)
at C:\Users\jgols\AppData\Roaming\npm\node_modules\cordova\src\cli.js:388:68
at _fulfilled (C:\Users\jgols\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\q\q.js:787:54)
at self.promiseDispatch.done (C:\Users\jgols\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\q\q.js:816:30)
at Promise.promise.promiseDispatch (C:\Users\jgols\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\q\q.js:749:13)
at C:\Users\jgols\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\q\q.js:557:44
at flush (C:\Users\jgols\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\node_modules\q\q.js:108:17)
at process._tickCallback (internal/process/next_tick.js:150:11)
(node:10036) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:10036) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
I've tried researching both and I can't seem to fix the crash because I have not found a similar thread with the same error. How can I fix the crash and how do I state my Android target?
Upvotes: 1
Views: 693
Reputation: 598
It's not you. It's a Cordova bug:
https://issues.apache.org/jira/browse/CB-13740
Upvotes: 1