Android: How to Solve Execution failed for task ‘:app:compileDebugJavaWithJavac‘. > javax/xml/bind/JAXBException

I recently upgraded Android studio 4.1.3 to the latest version 4.2.1, and the following error was reported when running the project:

The following project options are deprecated and have been removed:
android.databinding.enableV2
Databinding v1 is removed.

Unable to load class ‘javax.xml.bind.JAXBException’.

This is an unexpected error. Please file a bug containing the idea.log file.

Execution failed for task ‘:app:compileDebugJavaWithJavac’.
> javax/xml/bind/JAXBException

I was puzzled. I searched the Internet and found the reason. The Databinding framework requires Java 8 and below. The above version lacks some classes.

The new version of AS comes with 11, and then the jdk path is changed to 8, but it is not allowed to change, theoretically it should be possible to change it, there is no way, only the one before installation

AS4.1.3 version, and then run the project OK. Of course, this method is conservative and safe. If you have to use JDK11, it is estimated that the project will be changed.

Read More:

Leave a Reply

Your email address will not be published. Required fields are marked *