` @Override
public void onMapReady(@NonNull MapboxMap mapboxMap) {
mMapboxMap = mapboxMap;
mapboxMap.setStyle(new Style.Builder().fromUrl(getString(R.string.navigation_guidance)), new Style.OnStyleLoaded() {
@Override
public void onStyleLoaded(@NonNull Style style) {
if (style.isFullyLoaded()) {
navigationMap = new NavigationMapboxMap(mapView, mMapboxMap);
navigationMap.updateCameraTrackingMode(NavigationCamera.NAVIGATION_TRACKING_MODE_NONE);
This line is causing the issue
navigationMap = new NavigationMapboxMap(mapView, mMapboxMap);
I checked this link https://github.com/mapbox/mapbox-gl-native/wiki/Android-6.x-to-7.x-migration-guide
and found something like this
In order to avoid java.lang.NullPointerException: Attempt to invoke virtual method 'boolean com.mapbox.mapboxsdk.maps.Style.isFullyLoaded()' on a null object reference, the provided style parameter in the LocationComponent#activate method has to be @nonnull and fully loaded. The best way is to pass the style provided in the OnStyleLoaded callback.
But still no luck. Can someone look into this.
Hey @shinejosephDev 👋 thanks for reaching out and report your issue.
Have you 👀 ComponentNavigationActivity#onMapReady
from the test app? It seems you're using a similar setup although it doesn't crash here 🤔
Could you add some more information for reproducing the crash or any other specifics around your setup? That would be really helpful because without having additional information, I'm unable to reproduce.
For implementation questions, you can send a message to [email protected] and reference this ticket. Also, please check out our help docs or post your question on Stack Overflow. The Android team is watching these questions. Thanks for understanding!
Closing here as OP was already asked in Stack Overflow https://stackoverflow.com/questions/54277903/android-crash-on-boolean-com-mapbox-mapboxsdk-maps-style-isfullyloaded-on-a
hi shine, i was facing the same issue and i tried all the solution. i updated to latest mapbox sdk 8.4.0, and is was following the ComponentNavigationActivity#onMapReady but still no luck than i found that we need to put
<item name="navigationViewLocationLayerStyle">@style/NavigationLocationLayerStyle</item>
<item name="navigationViewRouteOverviewDrawable">@drawable/ic_route_preview</item>
inside the custom instructions view style and apply it inside onCreate() like this
// For styling the InstructionView
setTheme(R.style.customInstructionView);
this solved the issue i hope it helps
here is the full style i used
<style name="customInstructionView" parent="AppTheme.ZIRO_NoActionBar"> <item name="navigationViewRouteStyle">@style/NavigationMapRoute</item> <item name="navigationViewLocationLayerStyle">@style/NavigationLocationLayerStyle</item> <item name="navigationViewDestinationMarker">@drawable/map_marker_light</item> <item name="navigationViewRouteOverviewDrawable">@drawable/ic_route_preview</item> <item name="navigationViewMapStyle">@string/mapbox_style_dark</item> </style>