flutter-mapbox-gl / maps

A Mapbox GL flutter package for creating custom maps
Other
1.03k stars 498 forks source link

Google Play Services 21 IncompatibleClassChangeError FusedLocationProviderClient #1409

Open AAverin opened 5 months ago

AAverin commented 5 months ago

Reasoning

Google have introduced some breaking changes in Google Play Services 21.0.1 turning some classes into interfaces. This results in exceptions in production, especially if other location libraries like flutter location are used:

java.lang.IncompatibleClassChangeError: Found interface com.google.android.gms.location.FusedLocationProviderClient, but class was expected (declaration of 'com.google.android.gms.location.FusedLocationProviderClient'

Unfortunately because mapbox-core-andorid is no longer supported, it won't be migrated to 21+ implementation.

The best we can do is to pin play services to 20.0.0 in the library. This fixes exceptions in production builds, at least for example app.

Likely some changes in the project that uses this library will have to be made to make things work.

What changed

Force google play-services-location to 20.0.0 as this is the latest mapbox-core-android can support due to https://github.com/mapbox/mapbox-events-android/issues/577

stale[bot] commented 3 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.