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

Code : 2, Message: "unable to retrieve location", PERMISSION_DENIED:1,POSITION_UNAVAILABLE: 2. in IOS

Open jameerTSS opened this issue 4 years ago • 39 comments

Environment

Platforms

Versions

  • Android:
  • iOS:
  • react-native-geolocation:
  • react-native:
  • react:

Description

Code : 2, Message: "unable to retrieve location", PERMISSION_DENIED:1,POSITION_UNAVAILABLE: 2. in IOS simulator

Reproducible Demo

jameerTSS avatar Apr 29 '20 19:04 jameerTSS

Any solution for this? i am also facing the same problem

itvignes09 avatar May 05 '20 11:05 itvignes09

Any solution??

RahulkrishnanSpericorn avatar May 06 '20 12:05 RahulkrishnanSpericorn

Click your simulator then Select Features > Location > Custom Location

goodryanboy avatar May 08 '20 07:05 goodryanboy

Thank you for your reply

On Fri, May 8, 2020 at 12:35 PM Ryan mark Supremo [email protected] wrote:

Click your simulator then Select Features > Location > Custom Location

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/react-native-community/react-native-geolocation/issues/108#issuecomment-625671142, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOGOMTMWI7225DC35L5IK73RQOVM7ANCNFSM4MUASDPQ .

RahulkrishnanSpericorn avatar May 09 '20 11:05 RahulkrishnanSpericorn

so this problem is just on simulator?

jeffelector avatar Jun 07 '20 07:06 jeffelector

same problem on android device (not simulator)

rikopramayudi avatar Jun 08 '20 10:06 rikopramayudi

any solution?, i have same problem on real android device

achmadfaturrizky avatar Jun 17 '20 17:06 achmadfaturrizky

same problem on real android device

swaxtic avatar Jun 19 '20 12:06 swaxtic

same problem on real ios device

lcsvcn avatar Jun 26 '20 22:06 lcsvcn

Is this a common known issue? Why is this happening?

lcsvcn avatar Jun 30 '20 19:06 lcsvcn

Try to toggle the location button by swiping down the notification tray.

benjaminlogan420 avatar Jul 07 '20 10:07 benjaminlogan420

@goodryanboy answer solved for me.

Click your simulator then Select Features > Location > Custom Location

jgcmarins avatar Aug 04 '20 01:08 jgcmarins

{"code":3,"message":"Unable to fetch location within 30.0s.","PERMISSION_DENIED":1,"POSITION_UNAVAILABLE":2,"TIMEOUT":3} I have been getting this on ios, although it still gets the position

jordeguevara avatar Aug 08 '20 21:08 jordeguevara

Same on iOS devices. Any idea when this can be fixed?

emiliano1 avatar Aug 18 '20 02:08 emiliano1

Same problem in ios Simulator or real device. Any idea of how can we fix it?

Mitdd9707 avatar Sep 01 '20 10:09 Mitdd9707

Same issue in Android 10. Unable to get the the location {"PERMISSION_DENIED":1,"POSITION_UNAVAILABLE":2,"TIMEOUT":3, "code":2, "message":"No location provider available"}

prajna-h avatar Sep 03 '20 09:09 prajna-h

Click your simulator then Select Features > Location > Custom Location

I had this issue in the iOS Simulator, and was successful after trying @goodryanboy's solution (The default Simulator setting is None).

Perhaps making the error message a bit more descriptive than "No location provider available" could help steer people in that direction?

CypherPoet avatar Sep 05 '20 17:09 CypherPoet

same issue with ios!

anastely avatar Sep 16 '20 15:09 anastely

I am receiving this error on Android API 28 only. It works on API 29. Any idea why?

{"PERMISSION_DENIED": 1, "POSITION_UNAVAILABLE": 2, "TIMEOUT": 3, "code": 3, "message": "Location req
uest timed out"}

sabrimev avatar Sep 17 '20 05:09 sabrimev

none whatsoever. sorry

On Sep 17, 2020, at 1:24 AM, Sabri Meviş [email protected] wrote:

I am receiving this error on Android API 28 only. It works on API 29. Any idea why?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/react-native-community/react-native-geolocation/issues/108#issuecomment-693886421, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABGSMAQ3XJIQHNCSWLVGDNDSGGMPFANCNFSM4MUASDPQ.

INBINCOMOBI avatar Sep 17 '20 05:09 INBINCOMOBI

I am receiving this error on Android API 28 only. It works on API 29. Any idea why?

{"PERMISSION_DENIED": 1, "POSITION_UNAVAILABLE": 2, "TIMEOUT": 3, "code": 3, "message": "Location req
uest timed out"}

Same issue i am facing as well , still not able to figure what actually issue is

Location is not working on these devices where it's working other devices .

  1. hawaii p8 lite android Version 5
  2. hawaii y7 prime

Permission <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

React Native and lib version "@react-native-community/geolocation": "^2.0.2", "react-native": "0.62.2",

ZainaliSyed avatar Sep 19 '20 18:09 ZainaliSyed

这个问题有人解决吗?

weizhishu1901 avatar Sep 30 '20 09:09 weizhishu1901

Only on the location of device then run again the app and select allow you have good to go

WaseemAhmed645 avatar Sep 30 '20 17:09 WaseemAhmed645

if not gone then add fine-access-location permission in AndroidManifest File

WaseemAhmed645 avatar Sep 30 '20 17:09 WaseemAhmed645

  1. hawaii

SOLUTION

My location permission is working on every device

DONOT USE @react-native-community/geolocation

I simply use react-native-geolocation-service and it start working on every device of android

Permission <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

USE Library

https://github.com/Agontuk/react-native-geolocation-service

ZainaliSyed avatar Sep 30 '20 19:09 ZainaliSyed

Getting the same error on windows electron platform when using ionic native plugin - https://github.com/apache/cordova-plugin-geolocation/issues/213

hemangshah avatar Oct 16 '20 05:10 hemangshah

Working on android but same issue with iOS

ashu090990 avatar Oct 21 '20 06:10 ashu090990

anyone found any solution .?? its heck.

eramudeep avatar Nov 24 '20 13:11 eramudeep

There doesn't seem to be any way to catch this error, it definitely occurs when a user denies permission.. But I too switched to react-native-geolocation-service, and found it properly returns a useable error. We'll see if there's any new issues that come along with it..

SethArchambault avatar Jan 27 '21 00:01 SethArchambault

  1. hawaii

SOLUTION

My location permission is working on every device

DONOT USE @react-native-community/geolocation

I simply use react-native-geolocation-service and it start working on every device of android

Permission <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

USE Library

https://github.com/Agontuk/react-native-geolocation-service

What about iOS ?

paddy57 avatar Apr 24 '21 19:04 paddy57