react-native-geolocation icon indicating copy to clipboard operation
react-native-geolocation copied to clipboard

GPS doesn't work in some android systems:Location request timed out

Open LoongFei opened this issue 5 years ago • 23 comments

ReactNative: 0.57.8 react: 16.6.3 @react-native-community/geolocation: 1.4.2 I have configured location permissions:'ACCESS_FINE_LOCATION' in AndroidManifest.xml, but GPS doesn't work in some android systems:Location request timed out

PERMISSION_DENIED: 1 POSITION_UNAVAILABLE: 2 TIMEOUT: 3 code: 3 message: "Location request timed out"

LoongFei avatar Jul 09 '19 07:07 LoongFei

Try the following steps: (Taken from here)

Turn phone off/on Turn GPS off/on Disable any battery saver settings, including Power Saving Mode, Battery Management or any third party apps Perform an "AGPS reset": Install the App GPS Status & Toolbox, then in that app, go to Menu > Tools > Manage A-GPS State > Reset

sendyputra avatar Jul 11 '19 04:07 sendyputra

From Android 8.0 don't send location in background, alone send a few time per hour, https://developer.android.com/about/versions/oreo/background-location-limits?hl=es-419

There are other way, for example how a reproducer music, That app this in foreground in the notification bar.

chernandezq avatar Jul 22 '19 15:07 chernandezq

Same problem here. Any solution ? keeps giving me timeout

msqar avatar Aug 03 '19 16:08 msqar

Okay, after googling i found THIS on other repository a possible solution. It works by setting enableHighAccuracy: false. There might be an issue on android for high accuracy locations. Thank God i don't need super accuracy otherwise i would be raging lol. Hope it works for anyone who sees this. I hope there's an upcoming fix for Android.

msqar avatar Aug 03 '19 17:08 msqar

Okay, after googling i found THIS on other repository a possible solution. It works by setting enableHighAccuracy: false. There might be an issue on android for high accuracy locations. Thank God i don't need super accuracy otherwise i would be raging lol. Hope it works for anyone who sees this. I hope there's an upcoming fix for Android.

It worked for me. Thanks. It would be really nice for this lib to also work with high accuracy. I hope enableHighAccuracy: false is enough for my needs.

Tiagoperes avatar Aug 12 '19 18:08 Tiagoperes

@Tiagoperes glad it worked for you too man... i was frustrated about it as well.

msqar avatar Aug 12 '19 18:08 msqar

Ok. So it worked with enableHighAccuracy: false, but this is unacceptable. This means, that location will be taken from WiFi and not GPS. So the phone needs to have wify enabled. Sorry but this is not solution at all. Even if I really dont neeed highAccuracy.

oswaldjaroslav avatar Aug 17 '19 22:08 oswaldjaroslav

I have the same issue! Have you any update?

osvald0 avatar Aug 29 '19 02:08 osvald0

@osvald0 update to latest version, it's already fixed.

msqar avatar Aug 29 '19 02:08 msqar

I have the last version and I'm still getting the error in some phones:

  • Emulator (works with enableHighAccuracy false or true)
  • Samsung S8 android 9 (only works with enableHighAccuracy false)

Right now the app is using enableHighAccuracy: false and I have received timeout errors from the next devices:

  • Samsung | SM-A105M | Android 9
  • Samsung | SM-N950U | Android 9
  • HUAWEI | PRA-LX3 | Android 8.0.0
  • Motorola | moto e5 play | Android 8.1.0
  • Samsung | SM-A105M | Android 9
  • Hisense | Hisense F20 | Android 6.0.1
  • Lanix | X120C | 8.1.0

HugoLiconV avatar Sep 12 '19 18:09 HugoLiconV

I have the last version and I'm still getting the error in some phones:

  • Emulator (works with enableHighAccuracy false or true)
  • Samsung S8 android 9 (only works with enableHighAccuracy false)

Right now the app is using enableHighAccuracy: false and I have received timeout errors from the next devices:

  • Samsung | SM-A105M | Android 9
  • Samsung | SM-N950U | Android 9
  • HUAWEI | PRA-LX3 | Android 8.0.0
  • Motorola | moto e5 play | Android 8.1.0
  • Samsung | SM-A105M | Android 9
  • Hisense | Hisense F20 | Android 6.0.1
  • Lanix | X120C | 8.1.0

same error here.

device: Xiaomi | Redmi 6A | Android 8.1.0

ReactNative: 0.60.5 react: 16.9.0 @react-native-community/geolocation: 2.0.2

maoAmanda avatar Sep 27 '19 10:09 maoAmanda

same error here.

HUAWEI | PRA-LX3 | Android 6.0.1 ReactNative: 0.59.9 react: 16.8.3 @react-native-community/geolocation: 2.0.2

device: Xiaomi | MI 4LTE | Android 6.0.1 ReactNative: 0.59.9 react: 16.8.3 @react-native-community/geolocation: 2.0.2

mlop113 avatar Oct 29 '19 04:10 mlop113

Eu tenho a última versão e ainda estou recebendo o erro em alguns telefones:

  • Emulador (funciona com enableHighAccuracyfalso ou verdadeiro)
  • Samsung S8 android 9 (funciona apenas com enableHighAccuracyfalsos)

No momento, o aplicativo está em uso enableHighAccuracy: falsee recebi erros de tempo limite nos próximos dispositivos:

  • Samsung SM-A105M Android 9
  • Samsung SM-N950U Android 9
  • HUAWEI PRA-LX3 Android 8.0.0
  • Motorola moto e5 jogar | Android 8.1.0
  • Samsung SM-A105M Android 9
  • Hisense Hisense F20 | Android 6.0.1
  • Lanix X120C 8.1.0

same error here. next Flutter projects --'

Andersonfrfilho avatar Nov 14 '19 23:11 Andersonfrfilho

Hi guys! Any solution?

awmoreira avatar Nov 15 '19 00:11 awmoreira

Same here!

klosowsk avatar Jan 04 '20 14:01 klosowsk

Hi everyone , any solution on this guys!!

yasir-netlinks avatar Jan 12 '20 11:01 yasir-netlinks

Hey everyone! I just found a solution, I replaced this library for react-native-geolocation-service and it solved the problem, the API is the same so the change it's easy. I tested this with a couple of devices and everything seems working fine.

HugoLiconV avatar Jan 12 '20 18:01 HugoLiconV

Hey everyone! I just found a solution, I replaced this library for react-native-geolocation-service and it solved the problem, the API it's the same so the change its easy. I tested this with a couple of devices and everything seems working fine.

i love you.... ❤️

rafaelsevla avatar Apr 06 '20 03:04 rafaelsevla

react-native-geolocation-service fixed my issue thanks a lot

ranjansharma1412 avatar May 11 '20 08:05 ranjansharma1412

react-native-geolocation-service works fine in couple of days but then the Location request timed out error re-appeared and I don't know why, is there anyone face the same problem like me?

nathantqn avatar Oct 05 '20 08:10 nathantqn

@nenjamin2405 I'm facing the same issue. Did you find any solution? thanks

gregoryfm avatar Nov 18 '20 06:11 gregoryfm

Hey everyone! I just found a solution, I replaced this library for react-native-geolocation-service and it solved the problem, the API is the same so the change it's easy. I tested this with a couple of devices and everything seems working fine.

This is great !!!

vijaysaini83 avatar Jun 06 '21 18:06 vijaysaini83

even with react-native-geolocation-service have the same issue now

satya-imaginea avatar Feb 01 '22 09:02 satya-imaginea