Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Unable to load class 'javax.xml.bind.JAXBException'.

spent much time for this error but I don't get it , what's wrong with my code in android studio , when I run app

**Execution failed for task ':app:compileDebugJavaWithJavac'.

javax/xml/bind/JAXBException**

like image 504
Didier Supernover Avatar asked Feb 13 '21 18:02

Didier Supernover


Video Answer


5 Answers

I too faced the same issue when I updated my Android Studio to V4.2. I had to modify two files.

In build.gradle, I changed dependency from

classpath 'com.android.tools.build:gradle:3.6.3'

to

classpath 'com.android.tools.build:gradle:4.0.0'

In gradle-wrapper.properties, I changed the distributionUrl from

distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip

to

   distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
like image 134
Ganesh S S Avatar answered Oct 27 '22 02:10

Ganesh S S


I had the same problem and I solved it by changing the Android JDK path by JDK 8.

First you need to download and install JDK 8 from this link [JDK 8] (https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html)

and should change your JDK path manually: Go to Project Structure -> SDK Location -> JDK Location -> select the three dots button -> select the JDK 8 folder installed in your pc (generally it will be in C:\Program Files\Java\jdk1.8.. ) press ok. it solved this problem for me.

like image 10
Maher Ben Rhouma Avatar answered Oct 27 '22 03:10

Maher Ben Rhouma


I too faced this issue and this helped me to rectify. In build.grade, change the classpath to

classpath com.android.tools.build:gradle:4.0.0

In gradle-wrapper.properties, change the distributionUrl

distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
like image 2
Ramya Bm Avatar answered Oct 27 '22 02:10

Ramya Bm


this is because your Android Studio was upgraded to 4.2, and in 4.2 the AS is build in java 11, you should change your JDK path manually, Project Structure -> SDK Location, don't use your Android Studio.app's JDK path. install or change another one.

like image 1
T.Smith Avatar answered Oct 27 '22 03:10

T.Smith


I had the same problem and I solved it by updating "DSL element 'android.dataBinding.enabled' is obsolete and has been replaced with 'android.buildFeatures.dataBinding'"

android {

    buildFeatures {

         dataBinding true

         // for view binding:
         // viewBinding true
    }
}

Reference DSL element 'android.dataBinding.enabled' is obsolete and has been replaced with 'android.buildFeatures.dataBinding'

like image 1
Manoj Kumar Avatar answered Oct 27 '22 02:10

Manoj Kumar