Today i was trying to add an Android project to CIRCLE CI where i'm running ./gradlew lint test as a check for builds to pass. The issue is that i got some annoying errors and i'm struggling from hours to solve them:
on my local machine, i get: java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
and on CIRCLE CI the following error is thrown:
The first 3 errors (out of 10) were: /home/circleci/.gradle/caches/modules-2/files-2.1/javax.activation/activation/1.1.1/485de3a253e23f645037828c07f1d7f1af40763a/activation-1.1.1.jar: Error: Invalid package reference in library; not included in Android: java.awt.datatransfer. Referenced from javax.activation.ActivationDataFlavor. [InvalidPackage] /home/circleci/.gradle/caches/modules-2/files-2.1/javax.activation/activation/1.1.1/485de3a253e23f645037828c07f1d7f1af40763a/activation-1.1.1.jar: Error: Invalid package reference in library; not included in Android: java.awt.event. Referenced from com.sun.activation.viewers.TextEditor. [InvalidPackage] /home/circleci/.gradle/caches/modules-2/files-2.1/javax.activation/activation/1.1.1/485de3a253e23f645037828c07f1d7f1af40763a/activation-1.1.1.jar: Error: Invalid package reference in library; not included in Android: java.awt. Referenced from com.sun.activation.viewers.ImageViewer. [InvalidPackage]
I am using databinding in my android project, together with livedata and androidx. I've been searching the web for hours and nothing helped me. I tried to silence the errors with:
lintOptions {
abortOnError true
lintConfig file("lint.xml")
}
and lint.xml:
<lint>
<issue id="InvalidPackage">
<ignore path="**/activation*.jar"/>
</issue>
</lint>
Thanks in advance for any help. Please ask for more information if needed!