Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Could not invoke RTMGLLocationModule.start - Error on UserLocation #3046

Closed
lucas-samuel01 opened this issue Sep 13, 2023 · 7 comments

Comments

@lucas-samuel01
Copy link

lucas-samuel01 commented Sep 13, 2023

Mapbox Implementation

Mapbox

Mapbox Version

10

Platform

Android

@rnmapbox/maps version

10.0.12

Standalone component to reproduce

import React, {useState} from 'react';
import Mapbox from '@rnmapbox/maps';

const [userLocation, setUserLocation] = useState([0.0, 0.0]);
const [isPermissionGranted, setIsPermissionsGranted] = useState(false)

{isPermissionGranted &&
  <Mapbox.UserLocation
    minDisplacement={2} 
    onUpdate={(location) => {
      setUserLocation([location.coords.longitude, location.coords.latitude]);
    }}
  >
    <Mapbox.SymbolLayer
      id={'iconUserLocation'}
      style={{
        iconPitchAlignment: 'map',
        iconImage: 'arrow',
        iconSize: 0.14,
        iconRotate:0,
        iconAllowOverlap: true,
      }}
    />
    <Mapbox.CircleLayer
      id={'circle'}
      style={{
        circleColor:'rgba(255,255,225,0.3)',
        circleRadius: 60,
        circlePitchScale: 'map',
        circlePitchAlignment: 'map',
      }}
    />
  </Mapbox.UserLocation>
}

Observed behavior and steps to reproduce

This issue started happening on Friday 08/09/23 (day/month/year), and I don't know why, but the problem seems to be userLocation, when I comment out all the code from Mapbox userlocation, the error doesn't appear, but I'm not able to use the user location update or even append the user indicator to the screen. I think that it could be related to #2717, but I've tried every single response to this problem in that issue with no success. I'm using '@react-native-community/geolocation' to get the user's location as well.

Screenshot_20230912_174405

Expected behavior

No response

Notes / preliminary analysis

No response

Additional links and references

No response

@hexadecy
Copy link
Contributor

hexadecy commented Sep 19, 2023

I have this issue on Android 9 and 13 but only when @react-native-community/geolocation is at 3.1.0.
@rnmapbox/maps: 10.0.15
michalchudziak/react-native-geolocation@v3.0.6...v3.1.0
It seems to be a conflict.

I think it's because of this change:
'com.google.android.gms:play-services-location' 20.0.0 to 21.0.1

@RayanCardoso
Copy link

I had the problem "Invalid displacement" when I try to put only UserLocation on MapView. Someone with the same error?

@lucas-samuel01
Copy link
Author

Hey @RayanCardoso I also faced this issue, for me the only thing that worked was to make sure that I was rendering the UserLocation component after I had all the location permissions I don't kown other way around it.
For that I've created a state that changes to true when my permissions are granted, and I only render my UserLocation if that state is true

I also tried everything in that issue here #2717 (comment) but nothing worked

@hexadecy
Copy link
Contributor

hexadecy commented Sep 27, 2023

Make sure you have minDisplacement for Android.

<MapboxGL.UserLocation visible={hasLocationPermission} minDisplacement={10} />

@RayanCardoso
Copy link

Thanks @hexadecy and @lukssds that worked for me.

@mfazekas
Copy link
Contributor

@lukssds sorry can you add a full component, with MapView? I cannot run your code as is. Thanks!

@mfazekas
Copy link
Contributor

Sounds like duplicate of: #2717

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants