Skip to content

[Bug]: Crash/white screen on Android with CameraGestureObserver #4105

Closed

Description

@artanisdesign

Mapbox Implementation

Mapbox

Mapbox Version

11.16.2

React Native Version

0.81.5

React Native Architecture

New Architecture (Fabric/TurboModules)

Platform

Android

@rnmapbox/maps version

10.2.9

Standalone component to reproduce

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

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


class BugReportExample extends React.Component {
  render() {
    return (
      <MapView style={{flex: 1}}>
        <Camera centerCoordinate={[-74.00597, 40.71427]} zoomLevel={14} />
<CameraGestureObserver
              quietPeriodMs={200}
              maxIntervalMs={5000}
              onMapSteady={(event)=>{
console.log(event.nativeEvent)
}}
            />
        <ShapeSource id="idStreetLayer" shape={aLine}>
          <LineLayer id="idStreetLayer" />
        </ShapeSource>
      </MapView>
    );
  }
}

Observed behavior and steps to reproduce

ERROR Error: Unsupported top level event type "topOnMapSteady" dispatched

Expected behavior

not crash on android

Notes / preliminary analysis

So i've started to use the new CameraGestureObserver.

It does work on iOS flawlessly.

But on android, i get this error

Failed to print error: arg[0].includes is not a function (it is undefined) ERROR Error: Unsupported top level event type "topOnMapSteady" dispatched

deleted node modules, deleted lockfile.. deleted android folder. created new build, still the same.

please note that, im building it on expo EAS. (first i suspected some cache problems, but even after --clear-cache, the issue is still there).

Additional links and references

No response

Activity

  1. added
    bug 🪲
    on Dec 4, 2025
  2. Senninseyi commented on Dec 14, 2025

    @Senninseyi

    @artanisdesign have you any workaround about this

  3. chikamichi commented on Jan 9, 2026

    @chikamichi

    tl;dr: use onMapIdle instead of CameraGestureObserver.onMapSteady (it’s not ready).


    I encountered the same crash on Android with Fabric architecture (React Native 0.76+, Expo SDK 52):

    Error: Unsupported top level event type "topOnMapSteady" dispatched
    

    Use case: I needed to detect when camera animations end to show/hide a custom svg scale grid overlay during map interactions (pan, zoom, compass reset, etc.).

    What I tried:

    Working solution: Reverted to using MapView.onMapIdle which is Fabric-compatible and provides similar functionality:

    <MapboxGL.MapView
      onMapIdle={() => {
        // Called when map reaches idle state (no animations, no user gestures)
        setReady(true);
        stopAnimating(); // Hide loading states, show overlays, etc.
      }}
      // ...
    >

    Difference between the two:

    • onMapSteady (CameraGestureObserver): Fires specifically when camera movement ends
    • onMapIdle: Fires when map is fully idle (no pending tiles, no animations, no gestures)

    For most use cases like mine (showing UI elements after animations complete), onMapIdle works well as a substitute. The main downside is it may fire slightly later than onMapSteady since it waits for all map activity to complete, not just camera movement. And #4074 lists shortcomings that are real.

    Environment:

    • @rnmapbox/maps: 10.2.10
    • React Native: 0.76.x (New Architecture / Fabric enabled)
    • Expo SDK: 52
    • Android only (iOS not tested)

    Hope this helps others facing the same issue until a proper fix lands! 🙏

  4. Alvi24 commented on Feb 8, 2026

    @Alvi24

    having the same issue

  5. DavidAmyot commented on Feb 9, 2026

    @DavidAmyot

    +1

    Image
  6. added a commit that references this issue on Feb 21, 2026
    cbd0aa4
  7. added a commit that references this issue on Feb 22, 2026
    5a4e5ee
  8. added a commit that references this issue on Apr 22, 2026
    8abed13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🪲

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions