nitaliano / react-native-mapbox-gl

A Mapbox GL react native module for creating custom maps
Other
2.16k stars 697 forks source link

accessToken is required on Android? #1607

Closed awdhootlele closed 5 years ago

awdhootlele commented 5 years ago

Hello,

I am using custom styles in my application, so I removed the setAccessToken() call. Since then, my app started to crash on Android with the error pointing to above call. It seems, on Android, the setAccessToken() is required.

On IOS, app runs properly without the accessToken.

Also, on the mapbox-gl-native repo, the PR to make the accesToken optional has been merged.

Is is possible to make the accessToken optional on Android SDK as well?

Thanks.

btw the error is - com.mapbox.mapboxsdk.exceptions.MapboxConfigurationException: Using MapView requires setting a valid access token. Use Mapbox.getInstance(Context context, String accessToken) to provide one. Please see https://www.mapbox.com/help/create-api-access-token/ to learn how to create one.

sfratini commented 5 years ago

The current version of the RN repo uses an Android native sdk that is before that PR so yes, it is needed. I understand this will change once v7 drops.