Consider moving away from JAXB, to be Android friendly
See original GitHub issueI’m writing an Android app that uses openkeepass. When I read/write a DB, I see:
java.lang.ClassNotFoundException: Didn't find class "javax.xml.bind.JAXB" on path: DexPathList[[zip file "/data/app/tf.tom.myapplication-1/base.apk"],nativeLibraryDirectories=[/data/app/tf.tom.myapplication-1/lib/x86, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at de.slackspace.openkeepass.xml.KeePassDatabaseXmlParser.toXml(KeePassDatabaseXmlParser.java:18)
at de.slackspace.openkeepass.KeePassDatabase.write(KeePassDatabase.java:426)
The reason is that Android’s javax.xml does provide the entirety of JAXB, nor does Android allow apps to include JARs that are in javax.*
This was news to me, and pretty disappointing.
Consequently, if libraries wish to be Android friendly, they should choose XML libraries other than JAXB, such as Jackson.
Would you be willing to do this? I can provide a PR, when I’m not busy.
Issue Analytics
- State:
- Created 8 years ago
- Comments:12 (12 by maintainers)
Top Results From Across the Web
Using JAXB with Google Android - Stack Overflow
I want to use for these purposes JAXB framework, because I have pre-annotated (using JAXB) java-class.
Read more >JAXB can be made to run on Android - docx4j
Since docx4j relies heavily on JAXB, the key to getting it working was getting JAXB – the reference implementation – to run on...
Read more >Top 10 Most Common Mistakes That Android Developers Make
These bugs are easily prevented, as long as we get the basics right! Here's a quick rundown of the 10 most common mistakes...
Read more >Migrate apps to Android 12 | Android Developers
Quick overview of the steps involved in bringing your app to Android 12.
Read more >View - Android Developers
If you have already depended on this class, consider copying the implementation from AOSP ... To get a particular view to take focus,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@vhschlenker I’ve managed to switch to SimpleXML on the new branch ‘feature-simplexml’. Could you help me and try if this works better on Android?
I’ve fixed the issues with the equals tests and merged to master. I think the exclusions should be made in the android project itself as they are purely android related.