Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update play-services-location to 21 make the lib crash #24

Open
hugomc92 opened this issue Oct 17, 2022 · 1 comment
Open

Update play-services-location to 21 make the lib crash #24

hugomc92 opened this issue Oct 17, 2022 · 1 comment

Comments

@hugomc92
Copy link

If you update

implementation 'com.google.android.gms:play-services-location:20.0.0'

to

implementation 'com.google.android.gms:play-services-location:21.0.0'

The lib crash on checkLocationSetting(), specifically:

SettingsClient client = LocationServices.getSettingsClient(context);
Task<LocationSettingsResponse> task = client.checkLocationSettings(builder.build());

when executing client.checkLocationSettings this exception occurs:

Found interface com.google.android.gms.location.SettingsClient, but class was expected (declaration of 'com.google.android.gms.location.SettingsClient'

With version 20 it works fine

@iamaanahmad
Copy link

Since updating com.google.android.gms:play-services-location from 20.0.0 to 21.0.1 has caused the error message "Could not find method exclude() for arguments [com.github.prabhat1707:EasyWayLocation:com.google.android.gms.location.FusedLocationProviderClient] on DefaultConfig$AgpDecorated_Decorated", you can either downgrade the play-services-location dependency to 20.0.0 or address the incompatibility issue with the EasyWayLocation library.

Option 1: Downgrade play-services-location to 20.0.0

To downgrade the play-services-location dependency to 20.0.0, replace the following line in your app's build.gradle file:

implementation 'com.google.android.gms:play-services-location:21.0.1'

with this line:

implementation 'com.google.android.gms:play-services-location:20.0.0'

This will revert the play-services-location dependency to the previous version, which may resolve the compatibility issue and allow the Gradle build to proceed without errors.

Option 2: Address incompatibility with EasyWayLocation library

If you want to keep using the latest version of play-services-location, you'll need to address the incompatibility issue with the EasyWayLocation library. This may involve checking for updates to the EasyWayLocation library or contacting the library developer for support.

Please note that using the deprecated properties, buildToolsVersion and compileSdkVersion, can also lead to compatibility issues. It's recommended to use the new properties, buildSdk and compileSdk, instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants