If I do not have location permission allowed and I set map view showUserLocation to true, my app crashes.
I think this is bit rude functionality from the lib, mapbox should check permissions before trying to do something which needs them.
FATAL EXCEPTION: main
Process: com.my.app, PID: 7597
java.lang.SecurityException: "gps" location provider requires ACCESS_FINE_LOCATION permission.
at android.os.Parcel.readException(Parcel.java:1620)
at android.os.Parcel.readException(Parcel.java:1573)
at android.location.ILocationManager$Stub$Proxy.requestLocationUpdates(ILocationManager.java:606)
at android.location.LocationManager.requestLocationUpdates(LocationManager.java:880)
at android.location.LocationManager.requestLocationUpdates(LocationManager.java:464)
at com.mapzen.android.lost.internal.FusionEngine.enableGps(FusionEngine.java:98)
at com.mapzen.android.lost.internal.FusionEngine.enable(FusionEngine.java:72)
at com.mapzen.android.lost.internal.LocationEngine.setRequest(LocationEngine.java:36)
at com.mapzen.android.lost.internal.FusedLocationProviderApiImpl.requestLocationUpdates(FusedLocationProviderApiImpl.java:50)
at com.mapbox.services.android.location.LostLocationEngine.requestLocationUpdates(LostLocationEngine.java:123)
at com.mapbox.rctmgl.components.mapview.RCTMGLMapView.onConnected(RCTMGLMapView.java:598)
at com.mapbox.services.android.location.LostLocationEngine.activate(LostLocationEngine.java:51)
at com.mapbox.rctmgl.components.mapview.RCTMGLMapView.enableLocationLayer(RCTMGLMapView.java:757)
at com.mapbox.rctmgl.components.mapview.RCTMGLMapView.onMapReady(RCTMGLMapView.java:249)
at com.mapbox.mapboxsdk.maps.MapView$MapCallback.onMapReady(MapView.java:946)
at com.mapbox.mapboxsdk.maps.MapView$MapCallback.access$1000(MapView.java:911)
at com.mapbox.mapboxsdk.maps.MapView$MapCallback$1.run(MapView.java:929)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
I'll get this into 6.0.1 and it will be published tomorrow.
@hannta PR is out https://github.com/mapbox/react-native-mapbox-gl/pull/781
Closing this out as it's in master now and 6.0.1 will be published today
Hello,
Yet to 6.0.1 released, but I got the same issue, actually it doesn't request any permission whatsoever, but the release apk crashes anyway with the same error, do I have to request somewhere else than the installation setting ?
AndroidManifest.xml :
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
I also have the showUserLocation set to true
Do I miss something ?
Thanks in advance @nitaliano
Did you figure out whats the issue?
Still getting "gps" lcoation provider requires ACCESS_FINE_LOCATION permission
though it is set in the AndroidManifest.xml
@roesneb @nitaliano unfortunately, the problem remains
@GuillotJessica i figured out what was the problem for me.
If you look in the example App.js there are two Android relevant parts.
Unfortunately i only did the first part in componentWillMount (requestAndroidLocationPermissions)
but actually forgot check in the render function for the isGranted state change.
I got this error when i want to show user location in maps. I tried every thing but nothing work. After many tries i got solution then i decided to share with all developers. If it works please subscribe and share this video. https://www.youtube.com/watch?v=_mi_QNmXSwM
@roesneb @nitaliano unfortunately, the problem remains
check this it will work
I got this error when i want to show user location in maps. I tried every thing but nothing work. After many tries i got solution then i decided to share with all developers. If it works please subscribe and share this video. https://www.youtube.com/watch?v=_mi_QNmXSwM
If I do not have location permission allowed and I set map view
showUserLocationto true, my app crashes.I think this is bit rude functionality from the lib, mapbox should check permissions before trying to do something which needs them.
FATAL EXCEPTION: main Process: com.my.app, PID: 7597 java.lang.SecurityException: "gps" location provider requires ACCESS_FINE_LOCATION permission. at android.os.Parcel.readException(Parcel.java:1620) at android.os.Parcel.readException(Parcel.java:1573) at android.location.ILocationManager$Stub$Proxy.requestLocationUpdates(ILocationManager.java:606) at android.location.LocationManager.requestLocationUpdates(LocationManager.java:880) at android.location.LocationManager.requestLocationUpdates(LocationManager.java:464) at com.mapzen.android.lost.internal.FusionEngine.enableGps(FusionEngine.java:98) at com.mapzen.android.lost.internal.FusionEngine.enable(FusionEngine.java:72) at com.mapzen.android.lost.internal.LocationEngine.setRequest(LocationEngine.java:36) at com.mapzen.android.lost.internal.FusedLocationProviderApiImpl.requestLocationUpdates(FusedLocationProviderApiImpl.java:50) at com.mapbox.services.android.location.LostLocationEngine.requestLocationUpdates(LostLocationEngine.java:123) at com.mapbox.rctmgl.components.mapview.RCTMGLMapView.onConnected(RCTMGLMapView.java:598) at com.mapbox.services.android.location.LostLocationEngine.activate(LostLocationEngine.java:51) at com.mapbox.rctmgl.components.mapview.RCTMGLMapView.enableLocationLayer(RCTMGLMapView.java:757) at com.mapbox.rctmgl.components.mapview.RCTMGLMapView.onMapReady(RCTMGLMapView.java:249) at com.mapbox.mapboxsdk.maps.MapView$MapCallback.onMapReady(MapView.java:946) at com.mapbox.mapboxsdk.maps.MapView$MapCallback.access$1000(MapView.java:911) at com.mapbox.mapboxsdk.maps.MapView$MapCallback$1.run(MapView.java:929) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5417) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
I got this error when i want to show user location in maps. I tried every thing but nothing work. After many tries i got solution then i decided to share with all developers. If it works please subscribe and share this video. https://www.youtube.com/watch?v=_mi_QNmXSwM
@ahmedfaraz587 the video helps me to figure it out the problem, cheers
good
On Wed, 25 Dec 2019 at 07:14, JimmyLiu7323 notifications@github.com wrote:
@ahmedfaraz587 https://github.com/ahmedfaraz587 the video helps me to
figure it out the problem, cheers—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/nitaliano/react-native-mapbox-gl/issues/768?email_source=notifications&email_token=AMPFZAVFA5Y2VB3E3JVWMUDQ2K6Y7A5CNFSM4EEAIHP2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHTYWJQ#issuecomment-568822566,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AMPFZARS5UY3IMDAQ6MHYZTQ2K6Y7ANCNFSM4EEAIHPQ
.
Most helpful comment
Hello,
Yet to 6.0.1 released, but I got the same issue, actually it doesn't request any permission whatsoever, but the release apk crashes anyway with the same error, do I have to request somewhere else than the installation setting ?
AndroidManifest.xml :
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />I also have the showUserLocation set to true
Do I miss something ?
Thanks in advance @nitaliano