I'm trying to run the ./gradlew clean check but I'm facing the following error:
> Task :app:kaptDebugKotlin FAILED
e: java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
at java.base/java.lang.Class.getDeclaredConstructors0(Native Method)
at java.base/java.lang.Class.privateGetDeclaredConstructors(Class.java:3137)
at java.base/java.lang.Class.getConstructor0(Class.java:3342)
at java.base/java.lang.Class.newInstance(Class.java:556)
at org.jetbrains.kotlin.cli.jvm.plugins.ServiceLoaderLite.loadImplementations(ServiceLoaderLite.kt:50)
at org.jetbrains.kotlin.kapt3.ClasspathBasedKapt3Extension$loadProcessors$efficientProcessorLoader$1.doLoadProcessors(Kapt3Extension.kt:83)
... more ...
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXBException
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:471)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
There's anything that could be missing on gradle configuration?
I uninstall the Java 11 and install the java 8
Update your gradle version in project level gradle
classpath 'com.android.tools.build:gradle:4.x.x'
OR
Change File->Project Structure->SDK Location->JDK path to jdk 1.8 location "Home" folder which should be installed in your system.
If you are using Android Studio 3.6 or later go to Project Structure -> SDK Location and change JDK Location. Android Studio comes with default JRE. It is available in dropdown menu.
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