美文网首页
关于Android Studio报Unable to load

关于Android Studio报Unable to load

作者: benz0516 | 来源:发表于2024-03-26 09:51 被阅读0次

    使用JDK 9+时,您需要添加JAX-B依赖项。对于Android Studio用户,您需要将其添加到您app内的build.gradle的dependencies {}

    // Add missing dependencies for JDK 9+
    if (JavaVersion.current().ordinal() >= JavaVersion.VERSION_1_9.ordinal()) {
        // If you're using @AutoValue or any libs that requires javax.annotation (like Dagger)
        compileOnly 'com.github.pengrad:jdk9-deps:1.0'
        compileOnly 'javax.annotation:javax.annotation-api:1.3.2'
    
        // If you're using Kotlin
        kapt "com.sun.xml.bind:jaxb-core:2.3.0.1"
        kapt "javax.xml.bind:jaxb-api:2.3.1"
        kapt "com.sun.xml.bind:jaxb-impl:2.3.2"
    
        // If you're using Java
        annotationProcessor "com.sun.xml.bind:jaxb-core:2.3.0.1"
        annotationProcessor "javax.xml.bind:jaxb-api:2.3.1"
    
        testAnnotationProcessor "com.sun.xml.bind:jaxb-core:2.3.0.1"
        testAnnotationProcessor "javax.xml.bind:jaxb-api:2.3.1"
    }
    

    参考地址:https://stackoverflow.com/questions/43574426/how-to-resolve-java-lang-noclassdeffounderror-javax-xml-bind-jaxbexception

    相关文章

      网友评论

          本文标题:关于Android Studio报Unable to load

          本文链接:https://www.haomeiwen.com/subject/ppkstjtx.html