. Advertisement .
..3..
. Advertisement .
..4..
The following warning error may appear when you try to run the program: Unable to load class ‘javax.xml.bind.JAXBException’ This is an unexpected error Please file a bug containing the idea.log file in Java.
This is a common error made by all coders. So, why does it happen, and how could it be resolved? We’ll talk about everything with you.
Why Does The ” Unable to load class ‘javax.xml.bind.JAXBException’ This is an unexpected error Please file a bug containing the idea.log file in Java” error Occur?
Recently when you run your app and update the Android Studio to V4.2. The problem is can be the Android Studio was not upgraded to 4.2, and in 4.2 the AS is build in java 11. Then, you face the following error.
Execution failed for task ':app:compileDebugJavaWithJavac'. javax/xml/bind/JAXBException
Unable to load class 'javax.xml.bind.JAXBException' This is an unexpected error Please file a bug containing the idea.log file.
Some Fundamental Methods
And, you know what, you might be able to solve the above error with some simple ways. We can better understand these responses by using the cases below.
Method 1
In build.gradle, you can change dependency from this code
classpath 'com.android.tools.build:gradle:3.6.3'
To the code below.
classpath 'com.android.tools.build:gradle:4.0.0'
In gradle-wrapper.properties, you change the distributionUrl from
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
To the following code.
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
Method 2
We had the same issue and fixed it by updating “DSL element ‘android.dataBinding.enabled’ is obsolete and has been replaced by ‘android.buildFeatures.dataBinding'”
android {
buildFeatures {
dataBinding true
// for view binding:
// viewBinding true
}
}
We believe that the above solutions will be beneficial to all readers.
Conclusion
The remedies presented above have been the most effective for individuals who are still perplexed by this error: Unable to load class ‘javax.xml.bind.JAXBException’ This is an unexpected error Please file a bug containing the idea.log file in Java.
When you still seek help or have other questions, we have a big community where everybody is always willing to help you. Lastly, we hope all readers have a fantastic day with innovative code solutions.
Leave a comment