Using cordova on WINDOWS 10 I'm not able to build project.
When I tried cordova requirements
it shows me Android target: not installed
.
I tried all possible solutions over internet and SO, however, none worked for me. Probably this is related to the latest version of cordova v 8.0.0.
I tried the following which did NOT work:
1. overwriting tools folder from cordova CLI in my C:\Users\admin\AppData\Local\Android\Sdk
folder.
2. cordova platform remove android
and then cordova platform add [email protected]
3. Uninstalling and reinstalling all SDKs in Android Studio.
4. <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="26" />
5. Updated config.xml
file with
<platform name="android">
<preference name="android-minSdkVersion" value="16"/>
<preference name="android-targetSdkVersion" value="26"/>
<!--other line code -->
</platform>
Following is the log after firing the requirements command:
Android Studio project detected
Requirements check results for android:
Java JDK: installed
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.parseSdk(AvdManagerCli.java:328)
at com.android.sdklib.tool.AvdManagerCli.run(AvdManagerCli.java:204)
at com.android.sdklib.tool.AvdManagerCli.main(AvdManagerCli.java:195)
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:190)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499)
... 6 more
Gradle: installed
Please suggest a solution to fix this issue.
Finally I fixed it! I downgraded my JDK to version 8.172. Seems like JDK version above 8 is not supported by Android SDK. Then, update your JAVA_HOME path in the Environment Variables to point to the new JDK folder path. If you are using Mac or *nix boxes, you may also try jenv as well (I could not try jenv, but let me know if it did work for you)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With