title: E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.vrtour, PID: 14793
body: <p>I am trying to integrate navigation on a site map using mapbox but my app crashed when I click on the site map page</p>
  <p>E/AndroidRuntime: FATAL EXCEPTION: main
  Process: com.example.vrtour, PID: 14793
  java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/localbroadcastmanager/content/LocalBroadcastManager;
  at com.mapbox.android.telemetry.TelemetryService.registerLocationReceiver(TelemetryService.java:163)
  at com.mapbox.android.telemetry.TelemetryService.createLocationReceiver(TelemetryService.java:158)
  at com.mapbox.android.telemetry.TelemetryService.onCreate(TelemetryService.java:41)
  at android.app.ActivityThread.handleCreateService(ActivityThread.java:3532)
  at android.app.ActivityThread.access$1300(ActivityThread.java:199)
  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1666)
  at android.os.Handler.dispatchMessage(Handler.java:106)
  at android.os.Looper.loop(Looper.java:193)
  at android.app.ActivityThread.main(ActivityThread.java:6669)
  at java.lang.reflect.Method.invoke(Native Method)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
  Caused by: java.lang.ClassNotFoundException: Didn't find class &quot;androidx.localbroadcastmanager.content.LocalBroadcastManager&quot; on path: DexPathList[[zip file &quot;/data/app/com.example.vrtour-7_IWX5sSQKzHKJREz6hETw==/base.apk&quot;],nativeLibraryDirectories=[/data/app/com.example.vrtour-7_IWX5sSQKzHKJREz6hETw==/lib/x86, /data/app/com.example.vrtour-7_IWX5sSQKzHKJREz6hETw==/base.apk!/lib/x86, /system/lib]]
  at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
  at com.mapbox.android.telemetry.TelemetryService.registerLocationReceiver(TelemetryService.java:163) 
  at com.mapbox.android.telemetry.TelemetryService.createLocationReceiver(TelemetryService.java:158) 
  at com.mapbox.android.telemetry.TelemetryService.onCreate(TelemetryService.java:41) 
  at android.app.ActivityThread.handleCreateService(ActivityThread.java:3532) 
  at android.app.ActivityThread.access$1300(ActivityThread.java:199) 
  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1666) 
  at android.os.Handler.dispatchMessage(Handler.java:106) 
  at android.os.Looper.loop(Looper.java:193) 
  at android.app.ActivityThread.main(ActivityThread.java:6669) 
  at java.lang.reflect.Method.invoke(Native Method) 
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) 
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) </p>
  <p>My main activity code</p>
  <pre><code>    package com.example.vrtour;
  
  import androidx.annotation.NonNull;
  import androidx.appcompat.app.AppCompatActivity;
  
  import android.location.Location;
  import android.os.Bundle;
  import android.os.PersistableBundle;
  
  import com.mapbox.android.core.location.LocationEngine;
  import com.mapbox.android.core.location.LocationEngineListener;
  import com.mapbox.android.core.location.LocationEnginePriority;
  import com.mapbox.android.core.location.LocationEngineProvider;
  import com.mapbox.android.core.permissions.PermissionsListener;
  import com.mapbox.android.core.permissions.PermissionsManager;
  import com.mapbox.mapboxsdk.Mapbox;
  import com.mapbox.mapboxsdk.camera.CameraUpdateFactory;
  import com.mapbox.mapboxsdk.geometry.LatLng;
  import com.mapbox.mapboxsdk.maps.MapView;
  import com.mapbox.mapboxsdk.maps.MapboxMap;
  import com.mapbox.mapboxsdk.maps.OnMapReadyCallback;
  import com.mapbox.mapboxsdk.plugins.locationlayer.LocationLayerPlugin;
  import com.mapbox.mapboxsdk.plugins.locationlayer.modes.CameraMode;
  import com.mapbox.mapboxsdk.plugins.locationlayer.modes.RenderMode;
  
  import java.util.List;
  
  public class SiteMap extends AppCompatActivity implements OnMapReadyCallback, LocationEngineListener, PermissionsListener {
  
      private MapView mapView;
      private MapboxMap map;
      private PermissionsManager permissionsManager;
      private LocationEngine locationEngine;
      private LocationLayerPlugin locationLayerPlugin;
      private Location originLocation;
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          Mapbox.getInstance(this,getString(R.string.access_token));
          setContentView(R.layout.activity_site_map);
          mapView = (MapView) findViewById(R.id.mapView);
          mapView.onCreate(savedInstanceState);
          mapView.getMapAsync(this);
      }
  
      @Override
      public void onMapReady(MapboxMap mapboxMap) {
          map= mapboxMap;
          enableLocation();
  
      }
  
      private void enableLocation(){
         if (PermissionsManager.areLocationPermissionsGranted(this)){
             initializeLocationEngine();
             initializeLocationLayer();
         }else {
             permissionsManager = new PermissionsManager(this);
             permissionsManager.requestLocationPermissions(this);
         }
      }
  
      private void initializeLocationEngine(){
          locationEngine = new LocationEngineProvider(this).obtainBestLocationEngineAvailable();
          locationEngine.setPriority(LocationEnginePriority.HIGH_ACCURACY);
          locationEngine.activate();
  
          Location lastLocation = locationEngine.getLastLocation();
          if (lastLocation !=null){
              originLocation = lastLocation;
              setCameraPosition(lastLocation);
          }else{
              locationEngine.addLocationEngineListener(this);
          }
      }
  
      private void initializeLocationLayer(){
          locationLayerPlugin = new LocationLayerPlugin(mapView,map,locationEngine);
          locationLayerPlugin.setLocationLayerEnabled(true);
          locationLayerPlugin.setCameraMode(CameraMode.TRACKING);
          locationLayerPlugin.setRenderMode(RenderMode.NORMAL);
  
      }
  
      private void setCameraPosition(Location location){
          map.animateCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(location.getLatitude(),
                  location.getLongitude()), 13.0 ));
      }
  
  
      @Override
      public void onConnected() {
          locationEngine.requestLocationUpdates();
  
  
      }
  
      @Override
      public void onLocationChanged(Location location) {
          if (location != null){
              originLocation=location;
              setCameraPosition(location);
          }
  
      }
  
      @Override
      public void onExplanationNeeded(List&lt;String&gt; permissionsToExplain) {
      //present toast or dialog
      }
  
      @Override
      public void onPermissionResult(boolean granted) {
          if (granted){
              enableLocation();
          }
      }
  
      @Override
      public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
          permissionsManager.onRequestPermissionsResult(requestCode, permissions, grantResults);
      }
  
      @Override
      protected void onStart() {
          super.onStart();
          if (locationEngine !=null){
              locationEngine.requestLocationUpdates();
          }
          if (locationLayerPlugin !=null){
              locationLayerPlugin.onStart();
          }
          mapView.onStart();
      }
  
      @Override
      protected void onResume() {
          super.onResume();
          mapView.onResume();
      }
  
      @Override
      protected void onPause() {
          super.onPause();
          mapView.onPause();
      }
  
      @Override
      protected void onStop() {
          super.onStop();
          if (locationEngine != null){
              locationEngine.removeLocationUpdates();
          }
          if (locationLayerPlugin != null){
              locationLayerPlugin.onStop();
          }
          mapView.onStop();
      }
  
      @Override
      public void onSaveInstanceState(Bundle outState) {
          super.onSaveInstanceState(outState);
          mapView.onSaveInstanceState(outState);
      }
  
      @Override
      public void onLowMemory() {
          super.onLowMemory();
          mapView.onLowMemory();
      }
  
      @Override
      protected void onDestroy() {
          super.onDestroy();
          if ( locationEngine != null){
              locationEngine.deactivate();
          }
          mapView.onDestroy();
      }
  
  
  
  }
  </code></pre>
  <p>My xml code</p>
  <pre><code>    &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;androidx.constraintlayout.widget.ConstraintLayout
      xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      xmlns:mapbox=&quot;http://schemas.android.com/apk/res-auto&quot;
      xmlns:tools=&quot;http://schemas.android.com/tools&quot;
      android:layout_width=&quot;match_parent&quot;
      android:layout_height=&quot;match_parent&quot;
      tools:context=&quot;.SiteMap&quot;&gt;
  
      &lt;com.mapbox.mapboxsdk.maps.MapView
          android:id=&quot;@+id/mapView&quot;
          android:layout_width=&quot;match_parent&quot;
          android:layout_height=&quot;match_parent&quot;
          mapbox:mapbox_cameraTargetLat= &quot;3.0246&quot;
          mapbox:mapbox_cameraTargetLng=&quot;101.5161&quot;
          mapbox:mapbox_styleUrl=&quot;mapbox://styles/mapbox/streets-v10&quot;
          mapbox:mapbox_cameraZoom=&quot;12&quot;&gt;
  
      &lt;/com.mapbox.mapboxsdk.maps.MapView&gt;
  
  &lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;
  
   
  </code></pre>