Status Update
Comments
ra...@google.com <ra...@google.com>
ra...@google.com <ra...@google.com> #2
so...@google.com <so...@google.com> #3
The implementation of my project is not different from the example project attached by fernando.
ma...@gmail.com <ma...@gmail.com> #4
ma...@gmail.com <ma...@gmail.com> #5
ma...@gmail.com <ma...@gmail.com> #6
so...@google.com <so...@google.com>
so...@google.com <so...@google.com> #7
As an alternative I am using FusedLocationProviderClient with PendingIntent:
IntentFilter intentFilter = new IntentFilter(ACTION_LOCATION);
registerReceiver(locationReceiver, intentFilter);
mFusedLocationClient.requestLocationUpdates(mLocationRequest, locationPendingIntent);
and
unregisterReceiver(locationReceiver);
mFusedLocationClient.removeLocationUpdates(locationPendingIntent)
Here is forked LocationUpdates repo with LeakCanary installed and an option to switch between LocationCallback and PendingIntent. LeakCanary not reporting anything when using PendingIntent.
so...@google.com <so...@google.com> #8
ca...@gmail.com <ca...@gmail.com> #9
so...@google.com <so...@google.com> #10
so...@google.com <so...@google.com> #11
aq...@gmail.com <aq...@gmail.com> #12
There is an issuetracker Component available these days for Play Services Location:
Maybe move this issue to that Component to track it better?
th...@gmail.com <th...@gmail.com> #13
I can't move it right now, but I think it's ok to stay here.
As I wrote in the code lab issue, I misunderstood when the rewrite went out (which should fix the issue).
It goes live in version 20 (current version location 19.0.1). The engineer who wrote the rewrite checked and wasn't seeing the same issue, i.e., it should be resolved.
However, that does mean we have to wait until 20 is released. I can check in again here when it's live for you to double check.
as...@gmail.com <as...@gmail.com> #14
nt...@gmail.com <nt...@gmail.com> #15
I haven't been on location in awhile, but I wanted to follow up on this.
The issue should be resolved with
so...@google.com <so...@google.com>
go...@gmail.com <go...@gmail.com> #16
go...@gmail.com <go...@gmail.com> #17
// problem
implementation "com.google.android.gms:play-services-location:21.0.1"
// no problem
implementation "com.google.android.gms:play-services-location:20.0.0"
java.lang.IncompatibleClassChangeError: Found interface com.google.android.gms.location.FusedLocationProviderClient, but class was expected (declaration of 'com.google.android.gms.location.FusedLocationProviderClient' appears
at com.google.android.libraries.maps.ka.zzcj.zzf(LocationSourceImpl.java:17)
at com.google.android.libraries.maps.ka.zzcj.zza(LocationSourceImpl.java:44)
at com.google.android.libraries.maps.ka.zzba.zzc(GoogleMapImpl.java:716)
at com.google.android.libraries.maps.GoogleMap.setMyLocationEnabled(GoogleMap.java:60)
at com.google.android.libraries.maps.zzak.zza(Unknown Source:2)
at com.google.android.libraries.maps.ka.zzbc.run(Unknown Source:3)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:223)
at android.os.Looper.loop(Looper.java:324)
at android.app.ActivityThread.main(ActivityThread.java:8482)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:582)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1061)
so...@google.com <so...@google.com> #18
FusedLocationProviderClient has changed from an abstract class in 20 to an interface in 21. You will need to recompile your code accordingly.
an...@gmail.com <an...@gmail.com> #19
com.google.android.gms:play-services-location:21.0.1
com.google.android.gms:play-services-base:18.01
Device details:
Google Pixel 6a, Android 13, Play Service version 23.23.16 (190400-540660214)
I had to use the suggested workaround:
val locationRequest = LocationRequest.Builder(Priority.PRIORITY_HIGH_ACCURACY, 1000).build()
val client: SettingsClient = LocationServices.getSettingsClient(context)
val builder: LocationSettingsRequest.Builder = LocationSettingsRequest
.Builder()
.addLocationRequest(locationRequest)
val gpsSettingTask: Task<LocationSettingsResponse> = client.checkLocationSettings(builder.build())
gpsSettingTask.addOnCompleteListener {locationSettingsResponseTask ->
try {
val settingsResponse = locationSettingsResponseTask.getResult(ApiException::class.java)
// request location
} catch (e: ApiException) {
when (e.statusCode) {
LocationSettingsStatusCodes.RESOLUTION_REQUIRED -> {
try {
if (e is ResolvableApiException) {
val resolvableException = e as ResolvableApiException
val intentSenderRequest = IntentSenderRequest
.Builder(resolvableException.resolution)
.build()
// request settings dialog
} else if (e.status.resolution != null) {
val intentSenderRequest = IntentSenderRequest
.Builder(e.status.resolution!!)
.build()
// request settings dialog
}
} catch (ex: Exception) {
}
}
else -> {
}
}
}
}
Description
Device Info
problem code
What was the expected result?
if take
exception.statusCode = LocationSettingsStatusCodes.RESOLUTION_REQUIRED
will be cast
exception as ResolvableApiException
What was the actual result? exception is not ResolvableApiException
Relevant logcat output
Addendum. My product code gives a different error.
Link to captured Android bug report (shared privately in Drive.)
none
Optional: Link to any screenshot(s) that demonstrate the issue (shared privately in Drive)
none