bunq / sdk_java

Java SDK for bunq API
MIT License
49 stars 24 forks source link

Used package javax.xml.bind not included in Android #111

Closed basst85 closed 5 years ago

basst85 commented 6 years ago

Steps to reproduce:

  1. Use bunq Java SDK in Android app.
  2. Build project in Android Studio.

What should happen:

  1. Build without invalid package error.

What happens:

  1. When running Gradle build, the following error occurs: sdk_java-1.0.1.jar: Error: Invalid package reference in library; not included in Android: javax.xml.bind. Referenced from com.bunq.sdk.security.SecurityUtils. [InvalidPackage]

SDK version and environment

Line in code where package is used: https://github.com/bunq/sdk_java/blob/develop/src/main/java/com/bunq/sdk/security/SecurityUtils.java#L20

basst85 commented 6 years ago

@kojoru Can you maybe give me an update on this?

stefan52a commented 5 years ago

So what did you do? Add compile 'javax.xml.bind:jaxb-api:2.3.0' to build.gradle dependencies ?

basst85 commented 5 years ago

@stefan52a so in your opinion that must fix this error? I'm gonna try that

stefan52a commented 5 years ago

@stefan52a so in your opinion that must fix this error? I'm gonna try that

No that's not my opinion, but it brought me closer, I think, to compiling the SDK. And I am also just wondering what you did do.

mo6zes commented 5 years ago

I have the same issue, any solutions? I tried building with java SE 8 and 11 and got the same error

basst85 commented 5 years ago

@stefan52a @mo6zes It's finally working here!

I've added "implementation 'javax.xml.bind:jaxb-api:2.2.4'" to the build.gradle, and xercesImpl.jar from "Apache Xerces2" to the lib-directory.

basst85 commented 5 years ago

I've added "implementation 'javax.xml.bind:jaxb-api:2.2.4'" to the build.gradle, and xercesImpl.jar from "Apache Xerces2" to the lib-directory, after this it's working on Android.

markok314 commented 2 years ago

Worked in my case:

    implementation "org.glassfish.jaxb:jaxb-runtime:2.3.3"
    annotationProcessor 'jakarta.xml.bind:jakarta.xml.bind-api:2.3.3'
    annotationProcessor 'org.glassfish.jaxb:jaxb-runtime:2.3.3'
    annotationProcessor 'javax.annotation:javax.annotation-api:1.3.2'

and also:

    packagingOptions {
        exclude 'META-INF/NOTICE.md'
        exclude 'META-INF/LICENSE.md'
    }

However, exact settings depend on the functionality used in the project.