question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problems with stax-api dependency on Android

See original GitHub issue

(note: offshoot of #116)

Although JDK 1.6 does include Stax API (javax.xml.stream), Google has chosen to create an arbitrary subset of the same and is not included this API. Earlier it even blocked attempts at including any non-included dependencies in javax. namespace, but apparently this has been resolved, at least as far as Stax API is included (by whitelisting?).

But. Since dependency is needed on Android, there is need to either add an otherwise unnecessary dependency (unnecesasry for J2SE/J2EE), which may add unnecessary jar in builds on non-Android platforms; or to add instructions to help Android developers add the dependency explicitly.

I will first add a note on README, for approach two.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
Chubaccacommented, Jan 24, 2019

@roberttaylor426 FWIW, I managed to get this working on Android by just listing stax as a separate dependency (it looks like javax.* aren’t blocked anymore).

implementation 'javax.xml.stream:stax-api:1.0-2'

I also had to add this to my proguard:

-dontwarn com.fasterxml.**
-keep class com.ctc.wstx.** { *; }
-dontwarn com.ctc.wstx.**

This might be helpful to other Android people.

0reactions
cowtowncodercommented, Apr 19, 2016

@cternes I don’t know: I don’t develop on Android. Please ask on mailing lists.

Read more comments on GitHub >

github_iconTop Results From Across the Web

jackson dependency build error with stax-api jar
This dependency comes with the com.fasterxml.jackson.xml.jar. I've updated the Android edition of the Restlet Framework in order to remove the ...
Read more >
HAPI FHIR Android client problems - Google Groups
Hello,. I am attempting to build an Android-based client for a FHIR server, and am trying to use the HAPI FHIR client with...
Read more >
Improve error messages for exceptions thrown from Jetifier
Reason: AmbiguousStringJetifierException, message: The given artifact contains a string literal with a package reference 'android.support.design.widget' that ...
Read more >
Missing keep rules when using konsume-xml with R8 (#17) · Issues ...
OrgXmlpullStaxParser which uses Android API; JavaxXmlStreamComBeaStaxParser which patches bugs in com.bea.stax parser but otherwise doesn't even import the com.
Read more >
Solving the XML Problem with Jackson - DZone
In the mobile space, Jackson XML works perfectly well on Android. However, the StAX API is not included in the Android JVM, so...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found