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

Android does not show user location #96

Open
tombien opened this issue Dec 7, 2022 · 9 comments
Open

Android does not show user location #96

tombien opened this issue Dec 7, 2022 · 9 comments

Comments

@tombien
Copy link

tombien commented Dec 7, 2022

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?

@tombien
Copy link
Author

tombien commented Dec 7, 2022

I find, that maybe problem is here (index.android.js)
Snímek obrazovky 2022-12-07 v 21 42 46
"showUserLocationMarker 2" is logged, but "showUserLocationMarker 3" not - I think this function does not end with resolve and is interrupted here.

@farfromrefug
Copy link
Member

@tombien can you try to add a try catch around that line and print the error?

@tombien
Copy link
Author

tombien commented Dec 8, 2022

@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)

@tombien
Copy link
Author

tombien commented Dec 9, 2022

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.

@farfromrefug
Copy link
Member

@tombien you can look up the java.lang.IncompatibleClassChangeError on the web. Something is wrong with the mapbox lib it seems

@tombien
Copy link
Author

tombien commented Dec 9, 2022

@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?

@guillemc23
Copy link

guillemc23 commented Jan 13, 2023

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.

@CatchABus
Copy link

@farfromrefug It seems this incompatibility issue has been fixed since mapbox v10.10.0 so plugin might need to use latest libraries.
mapbox/mapbox-maps-android#1752 (comment)

@farfromrefug
Copy link
Member

@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

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

No branches or pull requests

4 participants