ui-mapbox
ui-mapbox copied to clipboard
Android does not show user location
After last update, I dont know why, but I am not able to show user location on Android. I did not make any changes from last version. I am stuck with that... Plese do you have any tips?
I find, that maybe problem is here (index.android.js)
"showUserLocationMarker 2" is logged, but "showUserLocationMarker 3" not - I think this function does not end with resolve and is interrupted here.
@tombien can you try to add a try catch around that line and print the error?
@farfromrefug yea I can:
Error: java.lang.IncompatibleClassChangeError: Found interface com.google.android.gms.location.FusedLocationProviderClient, but class was expected (declaration of 'com.google.android.gms.location.FusedLocationProviderClient' appears in /data/app/~~EbH2EsGKlyepoHXJnLM-kQ==/disway.trails-a6kNhxXFYIdoRJueoem9Jw==/base.apk!classes2.dex)
Hello,
today I made as a workaround custom marker with blue dot icon. And I used NS Geolocation plugin and set a watchLocation to change markers coordinates.
In XML template on map I made this: ios:showUserLocation="true"
And the geolocation stuff I put into Application.android condition.
@tombien you can look up the java.lang.IncompatibleClassChangeError on the web. Something is wrong with the mapbox lib it seems
@farfromrefug yes, that is true, I will do it later. But I need to fix this very fast - so I made this with geolocation plugin for now. Nobody from contributors does not know, where is the problem?
This happened to me too recently. I have my showUserLocation tag set to true, but when the map loads for the first time, asks for permissions and when approved, nothing happens, the map stays on its default coordinates and the user's blue dot never appears.
To me, what broke the plugin was updating the @nativescript/geolocation plugin to 8.1.0, since this also requires to set up googlePlayServicesVersion = "21.+".
Sticking to @nativescript/[email protected] and googlePlayServicesVersion = "16.+" keeps its functionality and the error disappears.
@farfromrefug It seems this incompatibility issue has been fixed since mapbox v10.10.0 so plugin might need to use latest libraries. https://github.com/mapbox/mapbox-maps-android/issues/1752#issuecomment-1354535597
@CatchABus yes but i wont update the plugin myself since it became closed source and requires special setup to add your key to simply download the sdk. You can do it though but for me i ll stop at the last open sourced version of mapbox ;) I wont update that plugin anymore. Maybe i ll fork it one day if i need maplibre