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.

Error Last location unavailable

See original GitHub issue

I have this exception sometimes, on production (I can’t reproduce in dev mode)

Error
Last location unavailable
node_modules/@react-native-mapbox-gl/maps/javascript/modules/location/locationManager.js in call at line 21:63
    this.onUpdate = this.onUpdate.bind(this);
  }
  async getLastKnownLocation() {
    if (!this._lastKnownLocation) {
      const lastKnownLocation = await MapboxGLLocationManager.getLastKnownLocation();
      if (!this._lastKnownLocation && lastKnownLocation) {
        this._lastKnownLocation = lastKnownLocation;
      }
    }
    return this._lastKnownLocation;

Full log here: https://sentry.io/share/issue/8037c6ed509a496aaa969bc23698ab04/

I actually happens quite often, Android only.

Any idea ? I think it might be related to when GPS is unavailable but location permission is given or something…

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ferdicuscommented, Mar 17, 2020

Yeah, it’s a native error that bubbles up to the JS side. Will wrap

const lastKnownLocation = await MapboxGLLocationManager.getLastKnownLocation();

in a try...catch block to prevent crashes

Any wishes, what it should log out 😃 Should it log at all? 🤷‍♂

0reactions
ivaricommented, Mar 17, 2020

Possibly related / for more information: https://github.com/mapbox/mapbox-events-android/issues/419

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix a location unavailable error in the Android device ...
Just go to settings, then click location. Turn it on and agree to Improve location accuracy by this you can fix location unavailable...
Read more >
Mapbox failed last location React native - Stack Overflow
I found the answer by changing the location settings and changing the highAccuracy option and enable it.
Read more >
How to Fix “Location Not Available” on iPhone - MakeUseOf
The quickest way to resolve that is to force quit and relaunch the app in question. If that doesn't work, you must restart...
Read more >
Ultimate Guide To Fix Location Not Available iPhone In 2022
We have researched and run down the potential fixes on the "Location Not Available iPhone" error; follow along with the solutions below.
Read more >
How to Fix Location Unavailable Error on Android Device?
Fix Location Unavailable Error on Android Device · Is it really a GPS problem? Some apps that use GPS also need a data...
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