Fixed
Status Update
Comments
[Deleted User] <[Deleted User]> #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.
so...@google.com <so...@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.
[Deleted User] <[Deleted User]> #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.
so...@google.com <so...@google.com>
ja...@google.com <ja...@google.com> #6
I am also still experiencing this!
ja...@google.com <ja...@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.
Description
- Phone make and model: Samsung, Xiaomi, Nokia - any
- OS version: verified on OS 8.0 and 8.1
- ML Kit APIs and versions: 16.0.0-beta1
### STEPS ###
1. use EntityExtraction.getClient(options).downloadModelIfNeeded()
### EXPECTED ###
no crash
### ACTUAL ###
`okhttp3.internal.huc.OkHttpURLConnection` is referenced by `okhttp-urlconnection:3.12.1` within `com.google.mlkit:entity-extraction` but since versions > 3.13.1 of OkHttp removed this class, it crashes
### ADDITIONAL INFORMATION ###
okhttp3.internal.huc.OkHttpURLConnection.d(): [0x95] cannot access instance field q1.b0 p1.l0.n.e.b from object of type Unresolved Reference: p1.l0.n.f (declaration of 'okhttp3.internal.huc.OkHttpURLConnection' appears in /data/app/...==/base.apk:classes3.dex)