Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Bug]: Android crash using UserLocation #3799

Open
kvntzn opened this issue Mar 5, 2025 · 1 comment
Open

[Bug]: Android crash using UserLocation #3799

kvntzn opened this issue Mar 5, 2025 · 1 comment
Labels
bug 🪲 Something isn't working

Comments

@kvntzn
Copy link

kvntzn commented Mar 5, 2025

Mapbox Implementation

Mapbox

Mapbox Version

default

React Native Version

0.76.7

Platform

Android

@rnmapbox/maps version

10.1.37

Standalone component to reproduce

import React from 'react';
import {
  MapView,
  ShapeSource,
  LineLayer,
  UserLocation,
  Camera,
} from '@rnmapbox/maps';

const aLine = {
  type: 'LineString',
  coordinates: [
    [-74.00597, 40.71427],
    [-74.00697, 40.71527],
  ],
};

class App extends React.Component {
  render() {
    return (
      <MapView style={{flex: 1}}>
        <Camera />
        <UserLocation />
      </MapView>
    );
  }
}

Observed behavior and steps to reproduce

  • Android crash on Open
2025-03-05 10:49:47.080 19824-19824 AndroidRuntime          com.passenger          E  FATAL EXCEPTION: main
                                                                                                    Process: com.passenger, PID: 19824
                                                                                                    java.lang.NullPointerException: Attempt to invoke virtual method 'void com.facebook.react.bridge.CxxCallbackImpl.invoke(java.lang.Object[])' on a null object reference
                                                                                                    	at com.rnmapbox.rnmbx.NativeRNMBXLocationModuleSpec.emitOnLocationUpdate(NativeRNMBXLocationModuleSpec.java:38)
                                                                                                    	at com.rnmapbox.rnmbx.modules.RNMBXLocationModule.access$emitOnLocationUpdate(RNMBXLocationModule.kt:18)
                                                                                                    	at com.rnmapbox.rnmbx.modules.RNMBXLocationModule$onUserLocationChangeCallback$1.onLocationChange(RNMBXLocationModule.kt:62)
                                                                                                    	at com.rnmapbox.rnmbx.location.LocationManager.onLocationChanged(LocationManager.kt:251)
                                                                                                    	at com.rnmapbox.rnmbx.location.LocationManager.onSuccess(LocationManager.kt:260)
                                                                                                    	at com.rnmapbox.rnmbx.location.LocationManager.onSuccess(LocationManager.kt:93)
                                                                                                    	at com.mapbox.android.core.location.LocationEngineCommonCompatKt$toCommonCompat$1.onSuccess(LocationEngineCommonCompat.kt:99)
                                                                                                    	at com.mapbox.android.core.location.LocationEngineCommonCompatKt$toCommonCompat$1.onSuccess(LocationEngineCommonCompat.kt:93)
                                                                                                    	at com.mapbox.common.location.compat.LocationEngineImpl$liveTrackingObserver$1$onLocationUpdateReceived$lambda-2$lambda-1$$inlined$postOrCall$1.run(LocationEngineImpl.kt:361)
                                                                                                    	at android.os.Handler.handleCallback(Handler.java:959)
                                                                                                    	at android.os.Handler.dispatchMessage(Handler.java:100)
                                                                                                    	at android.os.Looper.loopOnce(Looper.java:232)
                                                                                                    	at android.os.Looper.loop(Looper.java:317)
                                                                                                    	at android.app.ActivityThread.main(ActivityThread.java:8705)
                                                                                                    	at java.lang.reflect.Method.invoke(Native Method)
                                                                                                    	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
                                                                                                    	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:886)```

### Expected behavior

_No response_

### Notes / preliminary analysis

_No response_

### Additional links and references

_No response_
@kvntzn kvntzn added the bug 🪲 Something isn't working label Mar 5, 2025
@github-actions github-actions bot closed this as completed Mar 5, 2025
@kvntzn
Copy link
Author

kvntzn commented Mar 5, 2025

Mapbox Implementation

Mapbox

Mapbox Version

default

React Native Version

0.76.7

Platform

Android

@rnmapbox/maps version

10.1.37

Standalone component to reproduce

import React from 'react';
import {
MapView,
ShapeSource,
LineLayer,
UserLocation,
Camera,
} from '@rnmapbox/maps';

const aLine = {
type: 'LineString',
coordinates: [
[-74.00597, 40.71427],
[-74.00697, 40.71527],
],
};

class App extends React.Component {
render() {
return (
<MapView style={{flex: 1}}>



);
}
}

Observed behavior and steps to reproduce

  • Android crash on Open
2025-03-05 10:49:47.080 19824-19824 AndroidRuntime          com.passenger          E  FATAL EXCEPTION: main
                                                                                                    Process: com.passenger, PID: 19824
                                                                                                    java.lang.NullPointerException: Attempt to invoke virtual method 'void com.facebook.react.bridge.CxxCallbackImpl.invoke(java.lang.Object[])' on a null object reference
                                                                                                    	at com.rnmapbox.rnmbx.NativeRNMBXLocationModuleSpec.emitOnLocationUpdate(NativeRNMBXLocationModuleSpec.java:38)
                                                                                                    	at com.rnmapbox.rnmbx.modules.RNMBXLocationModule.access$emitOnLocationUpdate(RNMBXLocationModule.kt:18)
                                                                                                    	at com.rnmapbox.rnmbx.modules.RNMBXLocationModule$onUserLocationChangeCallback$1.onLocationChange(RNMBXLocationModule.kt:62)
                                                                                                    	at com.rnmapbox.rnmbx.location.LocationManager.onLocationChanged(LocationManager.kt:251)
                                                                                                    	at com.rnmapbox.rnmbx.location.LocationManager.onSuccess(LocationManager.kt:260)
                                                                                                    	at com.rnmapbox.rnmbx.location.LocationManager.onSuccess(LocationManager.kt:93)
                                                                                                    	at com.mapbox.android.core.location.LocationEngineCommonCompatKt$toCommonCompat$1.onSuccess(LocationEngineCommonCompat.kt:99)
                                                                                                    	at com.mapbox.android.core.location.LocationEngineCommonCompatKt$toCommonCompat$1.onSuccess(LocationEngineCommonCompat.kt:93)
                                                                                                    	at com.mapbox.common.location.compat.LocationEngineImpl$liveTrackingObserver$1$onLocationUpdateReceived$lambda-2$lambda-1$$inlined$postOrCall$1.run(LocationEngineImpl.kt:361)
                                                                                                    	at android.os.Handler.handleCallback(Handler.java:959)
                                                                                                    	at android.os.Handler.dispatchMessage(Handler.java:100)
                                                                                                    	at android.os.Looper.loopOnce(Looper.java:232)
                                                                                                    	at android.os.Looper.loop(Looper.java:317)
                                                                                                    	at android.app.ActivityThread.main(ActivityThread.java:8705)
                                                                                                    	at java.lang.reflect.Method.invoke(Native Method)
                                                                                                    	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
                                                                                                    	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:886)```

### Expected behavior

_No response_

### Notes / preliminary analysis

_No response_

### Additional links and references

_No response_

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug 🪲 Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant