Thank you for the help. On android, when I have tried with implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.13.0', the latest version, getting no class found errors. Then I have tried randomly - see that 2.9.0 also worked but not later.
Also, any android developers, please share your experience working with Jackson. On Wednesday, December 1, 2021 at 1:39:12 AM UTC+5:30 [email protected] wrote: > On Tue, Nov 30, 2021 at 3:19 AM Lakshmi Narayana Malempati < > [email protected]> wrote: > >> Trying to use a java jar file on Android which uses Jackson lib. But >> getting the below errors, stack trace attached. >> java.lang.NoClassDefFoundError: Failed resolution of: >> Ljavax/xml/bind/annotation/XmlElement; >> Background: >> We have a java archive file, which uses jackson library - JAXB >> Annotations for serializing to xml.We are trying call the functionality >> from Android app. The same worked fine on windows. >> >> >> We are using the below gradle dependencies: >> implementation >> 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.1.1' >> > > This is a very, very old version from 2012; it should be upgraded for one, > but... > > >> implementation 'javax.xml.stream:stax-api:1.0-2' >> implementation 'com.fasterxml:aalto-xml:1.0.0' >> implementation group: 'com.fasterxml.jackson.module', name: >> 'jackson-module-jaxb-annotations', version: '2.13.0' >> > > This would not work with XML module 2.1.x -- typically Jackson component > versions should really have the same minor version (sometimes "close > enough" ones may happen to work tho). > > However: for the longest time, Android platform neither included nor > allowed JAXB api classes (java.xml.bind) or Stax (javax.xml.stream). > I don't know if this limitation was lifted at some point, and if so at > what version. > > >> >> Could someone please let me know what I am missing here. Does jackson >> works for Android to begin with? >> > > Jackson core components do work, but Javax extensions (like JAXB, Stax > API) have been problematic on Android. > > So I am not 100% sure if XML module works, and on which Android SDK > levels. I hope Android developers can share > their experiences. > > -+ Tatu +- > > >> >> Thanks. >> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "jackson-user" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/jackson-user/466f39b2-3061-49d4-9ff5-ba613974bc28n%40googlegroups.com >> >> <https://groups.google.com/d/msgid/jackson-user/466f39b2-3061-49d4-9ff5-ba613974bc28n%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- You received this message because you are subscribed to the Google Groups "jackson-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jackson-user/1b6366ca-4822-4be8-9683-355ee8ddff9bn%40googlegroups.com.
