-
-
Notifications
You must be signed in to change notification settings - Fork 860
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]: UserLocation doesn't work with other GeoLocation Services (Android) #2717
Comments
@0xcD3v I don't see 3rd party service in this example. Also what does doesn't work means, please be specific? |
I don't need to call the 3rd party service on the code it just stoped works by having it installed. i change the location on simulator the user location component doesn't move, the onUpdate function doesn't get triggered. i tried on a physical device and happens the same it only work's in IOS my build.gradle and i also have the api key on gradle.properties i installed @rnmapbox via yarn using this command: yarn add "rnmapbox/maps#main" |
@mfazekas i did a video showing what's happening report.mov |
@mfazekas hey, do you have updates about this issue? Do you need more information? |
@0xcD3v Sorry it's a community project, with limited resources. |
Hi, I'm experiencing the same issue. The UserLocation component's onUpdate function only fires once (on load) but doesn't fire again when the user location changes. Only occurs on Android. I've tested on #main (latest MapBox version) and on 10.0.0-beta.76 and both had this issue. I will try older Beta versions now to see if one works. To test, I'm building to my android device and then updating the location using the 'GPS emulator' app for Android, I find that this is the easiest and most reliable way to test the actual behaviour. |
@FrancoisVA thanks, are you also using other location services? |
I am using "react-native-geolocation-service": "5.3.1" |
@ mfazekas I tested on 10.0.0-beta.69, and the issue is not present there. There might be a more recent build (between 10.0.0-beta.69 and 10.0.0-beta.74) that also works, but I haven't had time to test on more versions. |
I tried go to that version and the issue is still present for me. "yarn add @rnmapbox/[email protected]" |
@0xcD3v I think it might be a cache issue with your package or something, but I don't know enough about RN to help you. Try deleting all packages and re-installing and cleaning the project I guess. I tried on 10.0.0-beta.70 and that works as well. @mfazekas it looks like this issue is present on all versions after 10.0.0-beta.70, I guess some change between 70 and 71 is wat caused the issue. Please let me know if this is something you will be able to resolve or if we will have to get rid of the other geolocation packages. |
@FrancoisVA Is working for me now the 10.0.0-beta.70 |
@FrancoisVA thank for checking looking at the diff of 70 and 71 v10.0.0-beta.70...v10.0.0-beta.71 I see that mapbox was bumped to 10.11.1 If you can check if downgrading the mapbox libs with RNMapboxImpl as describe in docs helps or not: https://github.com/rnmapbox/maps/blob/main/android/install.md#using-non-default-mapbox-version RNMapboxMapsLibs = {
implementation 'com.mapbox.maps:android:10.10.0'
implementation 'com.mapbox.mapboxsdk:mapbox-sdk-turf:6.10.0'
} |
@mfazekas I tried to do that, and the problem persists i updated to /maps-10.0.0-rc.8 and on ios i was unable to install " rnmapbox-maps (from (update): -> idk if the problem is cache of project or not, but i already removed the node modules, yarn clean cache, watchman clean and still persists ->Another issue i spotted it is when we open the app for the first time on android and i ask for permission the user location throws an error even if i accept the permisions, that isue doesn't occur on ios. |
Hi @mfazekas, sorry for the late reply. I tried jumping back onto rnmapbox/maps#main and setting the specific mapbox version in build.gradle, but the issue is still present. Did you see anything else that might cause the issue when you looked at the diff? |
This is also a problem I have been seeing intermittently for more than a year with our build. No one has been able to fix it so far; currently working with someone to try to build a work around for this case. Any help in solving this would be amazing for us! |
hey guys from the same component i provide here, i have another issue on IOS physical device. INVALID react tag, could not find RCTMGLMapView |
It looks like there might be a solution found in another bug report by wen-kai: I added |
I'm having the same issue, but adding Downgraded to |
Still the same problem with last v10.0.4 ! |
The same problem in v10.0.6. I tested with |
Throughout this issue there are quite a few different/unclear problems stated. Therefore it's hard to determine, who is confirming which problem. I figured at least one specific case described by @FrancoisVA in our app too:
To further clarify, the puck on the map does not update for This occurs due to no <MapboxGL.UserLocation
minDisplacement={1}
renderMode={UserLocationRenderMode.Normal}
onUpdate={() => console.log("location changed")}
/> Please give feedback 👍 👎 if this workaround works (only if you are experiencing this very same problem). You should be seeing a moving puck and getting "location changed" regularly, if you are simulating/moving your location. @mfazekas sadly I'm still not able to reproduce the bug in the example. I can only recreate it in our expo project. Through prebuild I added error logging to the
So under some circumstances when displacement is passed as |
Thank you @KiwiKilian This workaround worked for us, now UserLocation being updated on Android.
|
I encountered a similar error. Using react-native-geolocation-service 5.3.1 and rnmapbox v10.0.0-beta.64, there was no error. However when I added firebase as a dependency com.google.gms:google-services:4.3.15 I had the error Invalid Displacement -1,0 setSmallestDisplacement() with reference to the firebase dependency I had just installed. The error was related to using the userlocation in rnmpabox, which I fixed by upgrading to version 10.0.0-beta.69 ! |
Had the issue and setting minDisplacement={0} solved it. In doc, it is still said that default is 0 ! |
Using Mapbox version 10.0.0-beta.70 does not make a difference for me. I am using "react-native-background-geolocation": "^4.10.0", anyone found other solutions? |
I'm using And it works fine |
Adding |
Mapbox Implementation
Mapbox
Mapbox Version
10
Platform
Android
@rnmapbox/maps
version10.0.0-beta.11
Standalone component to reproduce
Observed behavior and steps to reproduce
This started when i switched to mac os, i have a project with rnmapbox and react-native-geolocation-service in linux android was working fine with both i could get updates from UserLocation but in mac os
that doesn't work anymore so i tried to figure out what was wrong, i started a new project and i could get update locations without react-native-geolocation-service installed, so i installed another lib @react-native-community/geolocation and still happens the same the UserLocation didn't work anymore, i only can work with UserLocation on android without any geolocation lib.
Expected behavior
No response
Notes / preliminary analysis
No response
Additional links and references
No response
The text was updated successfully, but these errors were encountered: