question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Location always instantly returns with a timeout

See original GitHub issue

Location request timed out this is the error I get whenever I’m trying to access the user’s location.

Here’s my code:

import Exponent from 'exponent';

export async function getPosition() {
	const {Location, Permissions} = Exponent;
	const {status} = await Permissions.askAsync(Permissions.LOCATION);

	if (status === 'granted') {
		return Location.getCurrentPositionAsync({enableHighAccuracy: true});
	} else {
		throw new Error('Location permission not granted');
	}
}

some component

componentDidMount() {
	getPosition().then((position) => {
		if (position) {
			console.log(position);
		}
	}).catch((e) => {
                    // this one is firing the error instantly
		alert(e + ' Please make sure your location (GPS) is turned on.');
	});
}

Android 6.0.1

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

4reactions
jesserudercommented, Feb 23, 2017

Ok we figured out how to reproduce this. Will fix it in the next release.

2reactions
jesserudercommented, Mar 13, 2017

I think that’s the same error @alexprice91. We’re doing a release this week and we’ll see if that fixes these issues.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android GPS timeout - Stack Overflow
I need a feature to 'get the GPS location and send it to the server, unless it takes more than one minute'. My...
Read more >
Geolocation.getCurrentPosition() - Web APIs | MDN
The Geolocation.getCurrentPosition() method is used to get the current position of the device.
Read more >
How to Fix the 504 Gateway Timeout Error on Your Site - Kinsta
Learn how to fix the 504 Gateway Timeout error code on your WordPress site. Simple, easy to follow solutions to bring your site...
Read more >
Request location updates - Android Developers
Appropriate use of location information can be beneficial to users of your app. For example, if your app helps the user find their...
Read more >
Troubleshoot Lambda function retry and timeout issues when ...
Average time that a full API request takes (until it's successfully returned); If retries should be made by the AWS SDK or code....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found