Skip to content

new nativeeventemitter() requires a non-null argument #480

New issue

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

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

Already on GitHub? Sign in to your account

Open
lincymathew-mobile opened this issue Apr 1, 2025 · 5 comments
Open

new nativeeventemitter() requires a non-null argument #480

lincymathew-mobile opened this issue Apr 1, 2025 · 5 comments

Comments

@lincymathew-mobile
Copy link

lincymathew-mobile commented Apr 1, 2025

When I try to initialize Countly instance in the latest react-native version, I get an error:

new nativeeventemitter() requires a non-null argument #480

This error is thrown by lines that user "Countly" for eg. the following:
if (await Countly.isInitialized()) {
console.warn('Countly is already initialized');
return;
}

await Countly.initWithConfig(countlyConfig); // Initialize the countly SDK.
Countly.appLoadingFinished();

Using:
"react-native": "0.78.0",
"countly-sdk-react-native-bridge": "^25.1.2",

@turtledreams
Copy link
Contributor

Hi @lincymathew-mobile I have just tried with RN 0.78.2 and countly 25.1.2 and faced no problems. Can you create a fresh app with npx @react-native-community/cli@latest init project_name and create the most basic scenario to reproduce your issue?

@olliiiver
Copy link

Hi. I have the same problem with the lastest version of react-native for expo

"react-native": "0.76.9",
"countly-sdk-react-native-bridge": "^25.1.2",

For me, it just appears on Android.

@turtledreams
Copy link
Contributor

@olliiiver then it possibly due to new architecture being enabled. Can you turn off new architecture and try again?

@olliiiver
Copy link

Hi @turtledreams

I did nothing special regarding architectures.

I've added a test repo here showing the issue:

https://github.com/olliiiver/country_react_test

@turtledreams
Copy link
Contributor

Hi @olliiiver thank you for the repo. Just cloned and run your app and everything is working fine (sdk initializes and events are sent and such). lincy above mentioned an error, in your case you are just seeing a warning, which you can ignore. Also you do not have to call Countly.isInitialized method anymore, you can directly initialize.
Also if you update your RN version you will need to disable new architecture option fyi.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants