Fixed
Status Update
Comments
sy...@google.com <sy...@google.com> #2
A link to another sample project demonstrating that the leak only happens when using: LocationServices.FusedLocationApi.requestLocationUpdates but does not happen using a deprecated method: googleMap.setOnMyLocationChangeListener.
https://github.com/fernandospr/android-maps-userlocation
[Deleted User] <[Deleted User]> #3
Hello, I'm also experiencing the memory leak in my activity responsible for the location service.
The implementation of my project is not different from the example project attached by fernando.
The implementation of my project is not different from the example project attached by fernando.
sy...@google.com <sy...@google.com>
sy...@google.com <sy...@google.com> #4
FYI this memory leak also seems to exist when using the new FusedLocationProviderClient. I took Fernano's sample from comment #2 and hacked it up to use the FusedLocationProviderClient and was still able to observe the leak upon exiting the activity.
ca...@instantbits.com <ca...@instantbits.com> #5
Leak still present in 2019 on latest play-services-location 16.0.0. 3+ years since first reported via linked Github issue, no fix or hint of acknowledgment. Clown college grade software engineering.
sy...@google.com <sy...@google.com> #6
I am also still experiencing this!
sy...@google.com <sy...@google.com> #7
Still present in 'com.google.android.gms:play-services-location:17.0.0'
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.
https://github.com/dejandobnikar/location-samples/tree/master/LocationUpdates
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.
ca...@instantbits.com <ca...@instantbits.com> #8
Thank you for your feedback. We assure you that we are doing our best to address all issues reported. For now, we will be closing the issue as won't fix obsolete. If this issue currently still exists, we request that you log a new issue along with the bug report here https://goo.gl/TbMiIO and reference this bug for context.
sy...@google.com <sy...@google.com> #9
ca...@instantbits.com <ca...@instantbits.com> #10
sy...@google.com <sy...@google.com> #11
re...@gmail.com <re...@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?
bu...@gmail.com <bu...@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.
Description
Which version of the Cast SDK are you using? Cast SDK 3 - I'm targeting Google Play Services 15
Fatal Exception: java.lang.IllegalStateException: GoogleApiClient is not connected yet.
at com.google.android.gms.common.api.internal.zzaj.execute(Unknown Source)
at com.google.android.gms.common.api.internal.zzbd.execute(Unknown Source)
at com.google.android.gms.common.api.internal.zzav.execute(Unknown Source)
at com.google.android.gms.cast.Cast$CastApi$zza.sendMessage(Unknown Source)
at com.google.android.gms.cast.framework.media.RemoteMediaClient$zza.zza(Unknown Source)
at com.google.android.gms.internal.cast.zzcm.zza(Unknown Source)
at com.google.android.gms.internal.cast.zzdh.zza(Unknown Source)
at com.google.android.gms.internal.cast.zzdh.zzda(Unknown Source)
at com.google.android.gms.internal.cast.zzdh.zza(Unknown Source)
at com.google.android.gms.internal.cast.zzdi.zza(Unknown Source)
at com.google.android.gms.internal.cast.zzdn.zza(Unknown Source)
at com.google.android.gms.internal.cast.zzdn.zza(Unknown Source)
at com.google.android.gms.internal.cast.zzdn.zzdc(Unknown Source)
at com.google.android.gms.internal.cast.zzdo.run(Unknown Source)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:241)
at android.app.ActivityThread.main(ActivityThread.java:6274)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)