Some devices cannot share their location data
Propo41 opened this issue · 5 comments
try changing provider
val location = mLocationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER)
try using googlel services: https://stackoverflow.com/questions/28535703/best-way-to-get-user-gps-location-in-background-in-android
This was released mid 2017 by Google.
Google Play services location APIs are preferred over the Android framework location APIs (android.location)
If you are currently using the Android framework location APIs, you are strongly encouraged to switch to the Google Play services location APIs as soon as possible.
Finally found a fix using google codelabs. Totally amazing ^^ https://codelabs.developers.google.com/codelabs/while-in-use-location#0 . How did it take me so long to find it? :)