EasyWayLocation
EasyWayLocation copied to clipboard
Update play-services-location to 21 make the lib crash
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
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.