mapbox / mapbox/mapbox-maps-android
java.lang.IncompatibleClassChangeError - when upgrading the playservices versions 16 to 21
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 578
- Forks
- 161
- PR merge metrics
- No merged PRs in 30d
Description
java.lang.IncompatibleClassChangeError: Found interface com.google.android.gms.location.FusedLocationProviderClient, but class was expected (declaration of 'com.google.android.gms.location.FusedLocationProviderClient' appears in /data/app/~~6aY63v-it6isrQ77Y6SmQg==/-cS7vSR3T6EeLrQH7PpNefA==/base.apk!classes21.dex)
at com.mapbox.android.core.location.GoogleLocationEngineImpl.requestLocationUpdates(GoogleLocationEngineImpl.java:58)
at com.mapbox.android.core.location.GoogleLocationEngineImpl.requestLocationUpdates(GoogleLocationEngineImpl.java:26)
at com.mapbox.android.core.location.LocationEngineProxy.requestLocationUpdates(LocationEngineProxy.java:34)
at com.mapbox.mapboxsdk.location.LocationComponent.onLocationLayerStart(LocationComponent.java:1259)
at com.mapbox.mapboxsdk.location.LocationComponent.enableLocationComponent(LocationComponent.java:1387)
at com.mapbox.mapboxsdk.location.LocationComponent.setLocationComponentEnabled(LocationComponent.java:516)
at com.wearehathway.apps.stock.views.map.AppMapFragment$setMyLocationVisibleOnMap$1.invoke(AppMapFragment.kt:236)
at com.wearehathway.apps.stock.views.map.AppMapFragment$setMyLocationVisibleOnMap$1.invoke(AppMapFragment.kt:229)
at com.wearehathway.apps.stock.views.map.DelayedAction$CustomAction.apply(AppMapFragment.kt:397)
at com.wearehathway.apps.stock.views.map.AppMapFragment.applyDelayedActions(AppMapFragment.kt:83)
at com.wearehathway.apps.stock.views.map.AppMapFragment.onMapStyleLoaded(AppMapFragment.kt:73)
at com.wearehathway.apps.stock.views.map.AppMapFragment.onViewCreated$lambda$3$lambda$2(AppMapFragment.kt:121)
at com.wearehathway.apps.stock.views.map.AppMapFragment.$r8$lambda$T0wldz_qDio9uRcLaBVkjOW7Alg(Unknown Source:0)
at com.wearehathway.apps.stock.views.map.AppMapFragment$$ExternalSyntheticLambda1.onStyleLoaded(D8$$SyntheticClass:0)
at com.mapbox.mapboxsdk.maps.MapboxMap.notifyStyleLoaded(MapboxMap.java:959)
at com.mapbox.mapboxsdk.maps.MapboxMap.onFinishLoadingStyle(MapboxMap.java:221)
at com.mapbox.mapboxsdk.maps.MapView$MapCallback.onDidFinishLoadingStyle(MapView.java:1328)
at com.mapbox.mapboxsdk.maps.MapChangeReceiver.onDidFinishLoadingStyle(MapChangeReceiver.java:198)
at com.mapbox.mapboxsdk.maps.NativeMapView.onDidFinishLoadingStyle(NativeMapView.java:1106)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:346)
at android.os.Looper.loopOnce(Looper.java:189)
at android.os.Looper.loop(Looper.java:317)
at android.app.ActivityThread.main(ActivityThread.java:8705)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:886)
Here are the libraries I'm using in the code:
// Mapbox
implementation files('libs/mapbox-android-plugin-annotation-v9-0.9.0.aar')
implementation files('libs/mapbox-android-plugin-places-v9-0.12.0.aar')
implementation files('libs/mapbox-android-sdk-9.2.1.aar')
implementation files('libs/mapbox-sdk-services-5.8.0.jar')
implementation files('libs/mapbox-java-geojson-2.2.10.jar')
implementation files('libs/mapbox-sdk-geojson-5.8.0.jar')
implementation files('libs/mapbox-sdk-core-5.8.0.jar')
implementation files('libs/mapbox-sdk-turf-5.7.0.jar')
implementation files('libs/mapbox-sdk-directions-refresh-models-5.9.0-alpha.1.jar')
implementation files('libs/mapbox-sdk-directions-models-5.9.0-alpha.1.jar')
implementation files('libs/mapbox-android-core-4.0.0.aar')
implementation files('libs/mapbox-android-gestures-0.7.0.aar')
implementation files('libs/mapbox-android-telemetry-7.0.0.aar')
implementation files('libs/mapbox-android-accounts-0.8.0.aar')
implementation files('libs/mapbox-android-plugin-localization-0.6.0.aar')
implementation files('libs/mapbox-android-geocoder-1.0.0.aar')
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at com.mapbox.android.core.location.GoogleLocationEngineImpl.requestLocationUpdates, especially GoogleLocationEngineImpl.java:58, and inspect how the listed Mapbox Android libraries interact with the upgraded Play Services versions. Reproduce the crash when enabling LocationComponent from AppMapFragment.kt, then verify that the incompatible class-change error no longer occurs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java, kotlin
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100