LocationUpdates app can't detect location on device with Android 10 when running with any fake GPS app to mock location
See original GitHub issueWhen I press ‘START UPDATES’ button in LocationUpdates app while running it with any fake GPS app on device with Android 10, I get the following exception:
11-24 19:23:18.876: I/MainActivity(31143): com.google.android.gms.common.api.ResolvableApiException: 6: RESOLUTION_REQUIRED
11-24 19:23:18.876: I/MainActivity(31143): at com.google.android.gms.common.internal.ApiExceptionUtil.fromStatus(Unknown Source:3)
11-24 19:23:18.876: I/MainActivity(31143): at com.google.android.gms.common.internal.zai.zaf(Unknown Source:2)
11-24 19:23:18.876: I/MainActivity(31143): at com.google.android.gms.common.internal.zaj.onComplete(Unknown Source:6)
11-24 19:23:18.876: I/MainActivity(31143): at com.google.android.gms.common.api.internal.BasePendingResult.zaa(Unknown Source:172)
11-24 19:23:18.876: I/MainActivity(31143): at com.google.android.gms.common.api.internal.BasePendingResult.setResult(Unknown Source:131)
11-24 19:23:18.876: I/MainActivity(31143): at com.google.android.gms.common.api.internal.BaseImplementation$ApiMethodImpl.setResult(Unknown Source:36)
11-24 19:23:18.876: I/MainActivity(31143): at com.google.android.gms.internal.location.zzbc.zza(Unknown Source:2)
11-24 19:23:18.876: I/MainActivity(31143): at com.google.android.gms.internal.location.zzar.dispatchTransaction(Unknown Source:11)
11-24 19:23:18.876: I/MainActivity(31143): at com.google.android.gms.internal.location.zzb.onTransact(Unknown Source:22)
11-24 19:23:18.876: I/MainActivity(31143): at android.os.Binder.execTransactInternal(Binder.java:1021)
11-24 19:23:18.876: I/MainActivity(31143): at android.os.Binder.execTransact(Binder.java:994)
Issue Analytics
- State:
- Created 3 years ago
- Reactions:7
- Comments:7
Top Results From Across the Web
5 Best Apps To Fake GPS On Android Without Mock Location ...
Floater - Fake GPS Location · First, click on Location · Then choose Mode · Click on “Device Only” option. · After that,...
Read more >How to Fake GPS on Android Without Mock Location? - iMyFone
Step 4: From Settings, tap on Developer Options. Step 5: After this select Set Mock Location App, and pick Fake GPS option from...
Read more >How to use fake gps on android without enable Mock Location ...
Im working for a delivery service which has an app that will detect my current location. Is there any way to fake my...
Read more >Configuring Mock Location on Android With Your Arrow GNSS ...
Finally, select Eos Tools Pro as the mock location app and close the menu. Note: For Android 5 and 6 users, you need...
Read more >How To Spoof your GPS Location on an Android - Alphr
If you scroll down below About Phone you will see Developer options. Tap it. · Now, we need to tap on the Select...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve been finding the same problem. I can’t get geofences to trigger with latest Android 11. I haven’t tried any other versions. It’s very frustrating. Looking at the code for this project it looks outdated but even following the latest Android code recommendations on their website I’ve not been able to get any Geofences to trigger using the latest Android Studio build emulator.
IMHO this is broken, a GeoFenceBroadCast Receiver should be all that’s necessary, but apparently it doesn’t work unless some service is asking the system for location updates. This happens both when you run google maps and when you start a ForeGround location service that has access to real time updates. So what I did was start a service that is looking for Fine location accuracy. See also: https://stackoverflow.com/questions/54348093/geofencing-in-background-on-android-8-or-9-does-not-work/69692654#69692654
I linked the google location-samples foreground service example in that stackOverFlow link. Basically I am doing nothing with the location updates received by the service, since I already have a GeoFenceBroadcastReciever registered. Previously, my geoFences would never get triggered on entry/exit. With the service I am able to now get the location updates timely enough that they trigger my geoFences. Without this foreGround location service the alternative is to run google maps. BTW, this behavior presents itself in both the Emulator and on a real device.
Not sure if there’s a better solution out there, I wish there was, as technically running a service just to get prompt triggering of geoFence broadCasts really stinks.
BTW, here’s my dirty dirty (but working) code:
https://github.com/Lcstyle/LazyBoneBLE/blob/master/app/src/main/java/com/tinysine/lazyboneble/geolocation/BackgroundGeoFenceLocationService.java