title: Mapbox can't get last location (Java)
body: <p>I use mapbox for android (java), when it tries to access the device location it gives me an error and closes the application. This problem does not occur when I try to use the app by simulating it.</p>
  
  <p>It seems that this code doesn't work.</p>
  
  <pre><code>private void enableLocationComponent(@NonNull Style loadedMapStyle) {
      if (PermissionsManager.areLocationPermissionsGranted(this)) {
          locationComponent = mapboxMap.getLocationComponent();
          LocationComponentActivationOptions locationComponentActivationOptions =
                  LocationComponentActivationOptions.builder(this, loadedMapStyle)
                          .useDefaultLocationEngine(false)
                          .build();
          locationComponent.activateLocationComponent(locationComponentActivationOptions);
          locationComponent.setLocationComponentEnabled(true);
          locationComponent.setCameraMode(CameraMode.TRACKING);
          locationComponent.setRenderMode(RenderMode.COMPASS);
  
          initLocationEngine();
      } else {
          permissionsManager = new PermissionsManager(this);
          permissionsManager.requestLocationPermissions(this);
      }
  </code></pre>
  
  <p>}</p>