question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Android 12 crash: MapboxGL.setTelemetryEnabled(boolean) causes NullPointerException

See original GitHub issue

Describe 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 image-20211213-083423

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:closed
  • Created 2 years ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
savvcommented, Jan 3, 2022

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.

1reaction
sedot42commented, May 4, 2022

It will be closed if no further activity occurs. Thank you for your contributions.

@stalebot I am very sad my activity is not good enough for you. 😦

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android crash on 'boolean com.mapbox.mapboxsdk.maps ...
NullPointerException : Attempt to invoke virtual method 'boolean com.mapbox.mapboxsdk.maps.Style.isFullyLoaded()' on a null object reference, the ...
Read more >
react-native-mapbox - Bountysource
Describe the bug private vodid stateChanged() getting called before mLocationComponent is initiated on map load hence resulting in NullPointerException
Read more >
maps - bytemeta
react-native-mapbox-gl - Mobile Event Listener issue ... Android 12 crash: MapboxGL.setTelemetryEnabled(boolean) causes NullPointerException.
Read more >
Font kerning not used - Tecnickcom/TCPDF - IssueHint
YOU MAY BE INTERESTED ; Android 12 crash: MapboxGL.setTelemetryEnabled(boolean) causes NullPointerException, 12, 2021-12-23, 2022-08-04 ; How to swap between two ...
Read more >
maps - githubmemory
Android 12 crash : MapboxGL.setTelemetryEnabled(boolean) causes NullPointerException ... Make software development more efficient, Also welcome to join our ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found