Re: [Simple-support] Android's Lint reporting "Invalid package reference in library"
Brought to you by:
niallg
|
From: Robbie B. <Rob...@sa...> - 2013-02-20 14:56:22
|
Thanks for the quick response. On Feb 19, 2013, at 6:29 PM, Niall Gallagher - Yieldbroker <Nia...@yi...<mailto:Nia...@yi...>> wrote: Just ignore this, it should be a warning only, this references StAX which is not available on Android. SimpleXML will default to XmlPull From: Robbie Brown [mailto:Rob...@sa...<http://sas.com>] Sent: Wednesday, 20 February 2013 8:57 AM To: sim...@li...<mailto:sim...@li...> Subject: [Simple-support] Android's Lint reporting "Invalid package reference in library" The new Android developer tools (21.1) are reporting many cases of invalid package references in the SimpleXML library jar. To see the problem, go to "Window->Run Android Lint" in Eclipse. I'm using Eclipse 4.2.1and SimpleXML library 2.7. A typical line is: "Invalid package reference in library; not included in Android: javax.xml.stream. Referenced from org.simpleframework.xml.stream.StreamProvider." A similar issue has been reported for the Flurry library: http://code.google.com/p/android/issues/detail?id=42828 Google's response is: "This check is actually specifically there *for* 3rd party jars. If you try to use for example a Swing API from your Android project in Eclipse, it won't compile; the classpath does not include javax.swing so you won't accidentally reference it. However, if you pick up a random library Jar, it's totally possible that that Jar file is referencing classes that are not part of Android, which could lead to runtime crashes. That's what this lint check looks for. Either the flurry library is being careful to ensure that none of the APIs supported on Android end up accidentally calling into code which calls classes that aren't present, or there's a lurking bug in there. If you're certain it's fine, you could suppress this specific lint check; it would be even better if whoever built this library would create an Android-only version of the library containing only code needed to run on Android." Although it doesn't seem to be causing a problem, it is a little worrisome. Is the SimpleXML code simply being careful to avoid usage of classes not included in Android? Thanks. |