Skip to content

[Bug]: WARN new NativeEventEmitter() was called with a non-null argument without the required addListener method. WARN new NativeEventEmitter() was called with a non-null argument without the required removeListeners method. #4000

@huszzsolt

Description

@huszzsolt

Mapbox Implementation

Mapbox

Mapbox Version

default

React Native Version

0.79.5

Platform

Android

@rnmapbox/maps version

10.1.45

Standalone component to reproduce

npx @react-native-community/cli init maptest --version 0.79.5

Follow Android installation steps: https://rnmapbox.github.io/docs/install#adding-mapbox-maven-repo

Replace ./index.js with

import {AppRegistry} from 'react-native';

import MapboxGL from '@rnmapbox/maps';

MapboxGL.setAccessToken('XXXX');

AppRegistry.registerComponent('maptest', () => ()=>null);

Observed behaviour and steps to reproduce

npx react-native run-android

Run the app.
Open React Native DevTools:

index.js:5 `new NativeEventEmitter()` was called with a non-null argument without the required `addListener` method.
index.js:5 `new NativeEventEmitter()` was called with a non-null argument without the required `removeListeners` method.
console.js:654 Running "maptest" with {"rootTag":11,"initialProps":{},"fabric":true}
Welcome to React Native DevTools
Debugger integration: Android Bridgeless (ReactHostImpl)


The warning is triggered by import MapboxGL from '@rnmapbox/maps';

Image

Expected behavior

No warnings at app start

Notes / preliminary analysis

There is another issue on this #3972, closed due to reproducibility - hence I have added details here.

It is a new architecture-specific.

I have seen a PR to address this issue: #3869, but it appears to include other changes that are not relevant to this specific issue.

I suspect the fix is something like https://github.com/rnmapbox/maps/pull/3869/files#diff-1d288e1376e18a2442c5f9b67a8b16c5d342763007eaf54d84c0160d9c04b33dR177, but I am not familiar with the codebase.

Additional links and references

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🪲Something isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions