React-native-geolocation-service: Not working

Created on 24 Jan 2018  路  19Comments  路  Source: Agontuk/react-native-geolocation-service

I implemented your service but i still have the timeout error on Android.
I use RN version 52 on Android 6.0

Most helpful comment

it writes out a error log "Unable to fetch location within 15.0s." in iOS

All 19 comments

Hello, can you try the example project and see if it works? Also which device are you using? Does it have a stock rom or other custom roms ?

I tried the example and i have the same issue. I use a HUAWEI GRA-UL00.
You can check the example result and the phone properties:
img_2981
img_2980

Can you try getting location with other apps such as Google Maps and see if it works ?

Yes it works when i use Google map and geolocation because he fill up the GPS cache of the phone. But how i can have geolocation without use GPS cache?

what's the timeout value, also are you using high accuracy? Can you increase the timeout and see if it still returns timeout error ? Also try restarting the device.

It would be great if you can provide android native logs by using adb shell logcat when requesting location. I saw on google that many people seems to have gps issues on Huawei P8/P9 devices, so not sure what the actual issue is.

I have the same result with a high timeout, i use :
{ enableHighAccuracy: true, timeout: 200000, maximumAge: 10000 },

I have the same issue with an S8 phone. I generated a logcat if you to see what appends.

logcat.txt

Best regards

I took a look at the log but didn't find anything useful to understand the actual issue, except for this line

01-25 14:55:09.417  3430  6519 I libgps  : Uknown message 0 in ../../../../tmp/14533598_251844/customers/huawei/k3v3android/delivery/libgps/libgps.cpp:326

The main problem with android devices is that in most of them gps issue exist. I also had timeout issue on my Xiaomi device, but it got fixed after software update. The devices you're testing with (Huawei P8/ Samsung S8), both seem to have this issue too, reported by many users. If you can, upload the logs of samsung device so I can take a look.

I'll try and see if anything can be done to fix this. In the mean time my suggestion is to checkout various location related settings and see if any particular configuration works for you. Also -

  • For Huawei device, try adding your app to the Protected Apps list
  • For Samsung, disable App Power Saving for your app
  • Try with enableHighAccuracy: false
  • Try disabling power saving mode if it's enabled
  • Update your device if any software update is available
  • Update Google play service if there's a new version
  • Try restarting the device
  • Try checking your gps with gps test apps in play store

Same for me here

I test on MEIZU MX5, sometimes it works fine, but more often it's not.

Can you try adding distanceFilter: 0 to the options and see if it helps ? I've added a FAQ section for some possible solutions, check if that helps.

@antonsivogrivov Does your MEIZU MX5 come with Google Play Service?

My target users are most likely from China which Google Play Services are not installed on their device.

No, I haven't got Google Play Service

it writes out a error log "Unable to fetch location within 15.0s." in iOS

@asifalikhokhar

Have you verified that the app has location permissions? I.e. if you go into Settings > Privacy > {{yourApp}} and enable location services, do you still have this timeout issue?

the simple answer is to step out of where you are and go to open space then try again.

Its simple science.

GPS services are affected by thick walls and cars.

This worked for me. No need to edit anything !!!

Closing due to inactivity, feel free to open new issue.

I am having a weird issue where when I test on my android s6 the gps location with my internal test track the location piece isn't working. It's a phone without cellular data, so maybe it's related to that, but I have no issues in any of my simulators. Wondering if cellular data would have something to do with it?

I had an issue in iOS where the permissions in system settings state "Ask next time" but it would never ask and always time out. Changed it to "Allow" in system settings and it started to work.

@asifalikhokhar

Have you verified that the app has location permissions? I.e. if you go into Settings > Privacy > {{yourApp}} and enable location services, do you still have this timeout issue?

Worked for me Thanks @asifalikhokhar

Was this page helpful?
0 / 5 - 0 ratings