Android 12 crash: MapboxGL.setTelemetryEnabled(boolean) causes NullPointerException
See original GitHub issueDescribe the bug
Calling MapboxGL.setTelemetryEnabled(boolean)
crashes on android. In logcat I can see that Telemetry is null and it reproduce even if I wait for map to load.
To Reproduce
Call MapboxGL.setTelemetryEnabled(boolean)
in componentDidMount()
, useEffect()
, or `onDidFinishLoadingMap().
Example:
import React from 'react';
import MapboxGL from '@react-native-mapbox-gl/maps';
const BugReportExample = () => {
useEffect(() => {
MapboxGL.setTelemetryEnabled(false);
}, [])
return (
<MapboxGL.MapView style={{flex: 1}} />
);
}
Expected behavior
Map initializes and mapbox telemetry is off.
Actual behavior App crashes on Android 12 (everytime).
Screenshots
Versions (please complete the following information):
Platform: Android Platform OS: Android 12 Device: Android emulator & GooglePixel Emulator/ Simulator: Same error on both Dev OS: Windows 10 Pro react-native-mapbox-gl Version: 8.5.0 React Native Version: 0.63.4
Additional context Problem is similar to issue: #1231 just reproduces only on Android 12
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (7 by maintainers)
Top GitHub Comments
I think this is related to this: https://github.com/mapbox/mapbox-gl-native-android/blob/main/CHANGELOG.md#962---july-7-2021
Update telemetry to 8.1.0 (okhttp3 variant) and events-core 5.0.0 to make project compatible with Android 12
By default, react-native-mapbox-gl runs on API 9.1.0, so it won’t be compatible with API 31, by the looks of it.
@stalebot I am very sad my activity is not good enough for you. 😦