BirjuVachhani / locus-android

An Awesome Kotlin Location library to retrieve location merely in 3 lines of code
https://birju.dev/posts/retrieve-location-in-just-3-lines-android/
Apache License 2.0
358 stars 40 forks source link

huawei support causes crash when calling "stopLocationUpdates" #90

Open mrzbn opened 1 year ago

mrzbn commented 1 year ago

probably adding HMS dependency solves the problem, but is there a way that I'm not forced to add the dependency?

ruifernando7 commented 6 months ago

any update on this? i'm having the same issue. The app crashed in runtime @BirjuVachhani

BirjuVachhani commented 6 months ago

I haven't gotten around it yet! If I understand this correctly, calling startLocationUpdates (without adding HMS dependency) works, only calling stopLocationUpdates fails, right?

Tushar-Salvi commented 1 month ago

yes, @BirjuVachhani calling stopLocationUpdates on pause or in background crash the app, here the code where it is crashing i.e LocationProvider class

internal fun stopUpdates() { logDebug("Stopping background location updates") isRequestOngoing.set(false) locationLiveData = MutableLiveData() gmsFusedLocationProviderClient.removeLocationUpdates(pendingIntent) hmsFusedLocationProviderClient.removeLocationUpdates(pendingIntent) // crash here }