Status Update
Comments
ra...@google.com <ra...@google.com> #2
Thank you for the nice reproduction. The problem is in the library that defines a service loader implementation file incorrectly. The file META-INF/services/org.xmlpull.v1.XmlPullParserFactory contains:
org.kxml2.io.KXmlParser,org.kxml2.io.KXmlSerializer
The spec clearly states that it should be one per line:
A service provider is identified by placing a provider-configuration file in the resource directory META-INF/services. The file's name is the fully-qualified binary name of the service's type. The file contains a list of fully-qualified binary names of concrete provider classes, one per line...
R8 also gives a warning regarding that:
Warning in /usr/local/google/home/mkroghj/dumps/b279996549/dump/program.jar:META-INF/services/org.xmlpull.v1.XmlPullParserFactory:
Unexpected reference to missing service implementation class in META-INF/services/org.xmlpull.v1.XmlPullParserFactory: org.kxml2.io.KXmlParser,org.kxml2.io.KXmlSerializer.
The reason the context is FastServiceLoader.load
is because that is where we enqueue the potential services that can be loaded. I guess this could try and figure out the concrete types that could be loaded instead of all types, but that is difficult since the method takes a class as argument.
R8 will read the type in the implementation as a type with name org.kxml2.io.KXmlParser,org.kxml2.io.KXmlSerializer
. You therefore, in principle, need to write -dontwarn org.kxml2.io.KXmlParser,org.kxml2.io.KXmlSerializer
. Now the problem here is that -dontwarn
takes a list of classes as argument, so we parse that into something similar to:
-dontwarn org.kxml2.io.KXmlParser
-dontwarn org.kxml2.io.KXmlSerializer
The only thing you can write is a prefix, so you could do -dontwarn org.kxml2.io.KXml*
and that will silence the compiler and succeed.
Regarding the library, I checked if the error was still present, but the service file was corrected over 3 years ago:
You could see if an update of the library you are using is available or use the -dontwarn
pattern above. Will be marking this as WAI.
an...@gmail.com <an...@gmail.com> #3
I have tried above pattern but that also fail
-dontwarn org.kxml2.io.KXml*
Can you please confirm from sample file with corrected pattern and working solution ?
an...@gmail.com <an...@gmail.com> #4
It should be two **. You can decide on any prefix you desire as long as it matches the path.
-dontwarn org.kxml2.io.KXml**
an...@gmail.com <an...@gmail.com> #5
Thanks mk@, using that pattern issue resolved for now.
pa...@google.com <pa...@google.com> #6
an...@gmail.com <an...@gmail.com> #7
an...@gmail.com <an...@gmail.com> #8
java.lang.IncompatibleClassChangeError: Class 'android.content.res.XmlBlock$Parser' does not implement interface 'org.xmlpull.v1.a' in call to 'int org.xmlpull.v1.a.next()' (declaration of 'androidx.core.content.FileProvider' appears in base.apk). Gradle 8.0 AGP 8.1.4
I solved it setting this proguard rule.
-keep class org.xmlpull.v1.** {*;}
Description
The following code example clearly reproduces the problem:
func testGroundOverlays() {
let image = UIImage(named: "redSquare512.jpg")
let southWest1 = CLLocationCoordinate2D(latitude: 55.83831352210822, longitude: 37.529296875)
let northEast1 = CLLocationCoordinate2D(latitude: 55.85064987433714, longitude: 37.55126953125)
let overlayBounds1 = GMSCoordinateBounds(coordinate: southWest1, coordinate: northEast1)
let detailOverlay1 = GMSGroundOverlay(bounds: overlayBounds1, icon: image)
detailOverlay1.map = googleMap
let southWest2 = CLLocationCoordinate2D(latitude: 55.825973254619015, longitude: 37.529296875)
let northEast2 = CLLocationCoordinate2D(latitude: 55.83831352210822, longitude: 37.55126953125)
let overlayBounds2 = GMSCoordinateBounds(coordinate: southWest2, coordinate: northEast2)
let detailOverlay2 = GMSGroundOverlay(bounds: overlayBounds2, icon: image)
detailOverlay2.map = googleMap
}
The link provides a screenshot of the results for versions 3.2.0 and 3.2.5:
Operating system version: iOS 13.1
Google Maps SDK for iOS version: 3.2.5