Geolocation timed out, code 3
See original GitHub issueDescription
I have geolocation running in my app, followed examples described in docs. IOS version works fine, android however works only on non xiaomi devices. I tried on 2 xiamomi devices, and got Location request timed out
error. While on samsung devices it works fine.
Reproduction
navigator.geolocation.getCurrentPosition(
(position) => {
let initialPosition = JSON.stringify(position);
console.log(initialPosition);
},
(error) => console.log(JSON.stringify(error)),
{enableHighAccuracy: Platform.OS != 'android', timeout: 2000, maximumAge: 2000 }
);
Solution
Need to find a way either provide reason why timed out, or just fix it.
Additional Information
- React Native version: 0.42
- Platform: Android
- Operating System: Mac OS
- Dev tools: Android SDK v23
Issue Analytics
- State:
- Created 7 years ago
- Reactions:20
- Comments:14 (2 by maintainers)
Top Results From Across the Web
React Native Android location request timed out - Stack Overflow
When my app cannot find my location, I tried via Google Maps app, it works like charm. Here is my code for both...
Read more >Geolocation Error: Time out code 3 - Google Groups
I've got the latest phonegap 1.2 and put the test code from the docs in my application. When I run my app both...
Read more >Solve “Location request timed out” problem when ... - Steve Mu
Solve “Location request timed out” problem when using geolocation in React Native. It took me a few hours just to make the navigator.geolocation...
Read more >[Location Plugin] GetLocation always has error Timeout ...
When running the application as a mobile app in an Android device, if the location cannot be retrieved in time, a "Position retrieval...
Read more >Geolocation-error-code-3 - npm.io
A workaround to get over the issue: "Geolocation timed out. Code 3". I just worked with Android OS only. In React Native docs....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top 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
For anyone else struggling with this issue on android, try removing the
maximumAge: 2000
option parameter. This option was causing geolocation to either timeout or crash the app.I’m running react-native 0.46.4 btw.
Hi there! This issue is being closed because it has been inactive for a while. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. Either way, we’re automatically closing issues after a period of inactivity. Please do not take it personally!
If you think this issue should definitely remain open, please let us know. The following information is helpful when it comes to determining if the issue should be re-opened:
If you would like to work on a patch to fix the issue, contributions are very welcome! Read through the contribution guide, and feel free to hop into #react-native if you need help planning your contribution.