Skip to content
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

[🐛] Invariant Violation: Native module cannot be null. - RNFBNativeEventEmitter #4265

Closed
1 of 9 tasks
mechazod opened this issue Sep 17, 2020 · 7 comments
Closed
1 of 9 tasks
Labels
help: needs-triage Issue needs additional investigation/triaging. type: bug New bug report

Comments

@mechazod
Copy link

mechazod commented Sep 17, 2020

Issue

I had tried to use the migration from v5 to latest release and it works fine. But my current concern is the jest --coverage test, which failing on my end.

react-native
"react": "16.9.0",
"react-native": "0.61.5",
package.json>dependencies:
"@react-native-firebase/analytics": "^7.6.2",
"@react-native-firebase/app": "^8.4.2",
"@react-native-firebase/crashlytics": "^8.4.4",
screenshot

Screen Shot 2020-09-17 at 11 17 32 AM


Project Files

Javascript

Click To Expand

package.json:

# N/A

firebase.json for react-native-firebase v6:

# N/A

iOS

Click To Expand

ios/Podfile:

  • [x ] I'm not using Pods
  • [] I'm using Pods and my Podfile looks like:
  • Autolink in Podfile.lock on installation pod install
Installing Firebase (6.30.0)
Installing FirebaseAnalytics (6.7.2)
Installing FirebaseCore (6.10.0)
Installing FirebaseCoreDiagnostics (1.5.0)
Installing FirebaseCrashlytics (4.4.0)
Installing FirebaseInstallations (1.7.0)
Installing RNFBApp (8.4.2)
Installing RNFBAnalytics (7.6.2)
Installing RNFBCrashlytics (8.4.4)

AppDelegate.m:

// N/A


Android

Click To Expand

Have you converted to AndroidX?

  • my application is an AndroidX application?
  • I am using android/gradle.settings jetifier=true for Android compatibility?
  • I am using the NPM package jetifier for react-native compatibility?

android/build.gradle:

// N/A

android/app/build.gradle:

// N/A

android/settings.gradle:

// N/A

MainApplication.java:

// N/A

AndroidManifest.xml:

<!-- N/A -->


Environment

Click To Expand

react-native info output:

 OUTPUT GOES HERE
  • Platform that you're experiencing the issue on:
    • iOS
    • Android
    • iOS but have not tested behavior on Android
    • Android but have not tested behavior on iOS
    • Both
  • react-native-firebase version you're using that has this issue:
    • e.g. 5.4.3
  • Firebase module(s) you're using that has the issue:
    • e.g. Instance ID
  • Are you using TypeScript?
    • Y/N & VERSION


@mechazod mechazod added help: needs-triage Issue needs additional investigation/triaging. type: bug New bug report labels Sep 17, 2020
@mikehardy
Copy link
Collaborator

#4081

@stale
Copy link

stale bot commented Nov 1, 2020

Hello 👋, to help manage issues we automatically close stale issues.
This issue has been automatically marked as stale because it has not had activity for quite some time. Has this issue been fixed, or does it still require the community's attention?

This issue will be closed in 15 days if no further activity occurs.
Thank you for your contributions.

@stale stale bot added the Type: Stale Issue has become stale - automatically added by Stale bot label Nov 1, 2020
@kevinlin505
Copy link

Hey @mechazod any lucks on this one? I am getting the exact same issue and the reference on #4081 doesn't work for me.

@stale stale bot removed the Type: Stale Issue has become stale - automatically added by Stale bot label Nov 6, 2020
@mechazod
Copy link
Author

mechazod commented Nov 7, 2020

@kevinlin505 What solution I did was installing the new version of Firebase v6+ via yarn, then I removed some conflicting libraries and back again after successful install. Also removed all old firebase v5.

@stale
Copy link

stale bot commented Dec 12, 2020

Hello 👋, to help manage issues we automatically close stale issues.
This issue has been automatically marked as stale because it has not had activity for quite some time. Has this issue been fixed, or does it still require the community's attention?

This issue will be closed in 15 days if no further activity occurs.
Thank you for your contributions.

@stale stale bot added the Type: Stale Issue has become stale - automatically added by Stale bot label Dec 12, 2020
@ghost
Copy link

ghost commented Dec 30, 2020

As mentioned by @mikehardy

#4081

mocking NativeEventEmitter worked for me,

jest.mock('react-native/Libraries/EventEmitter/NativeEventEmitter')

@stale stale bot removed the Type: Stale Issue has become stale - automatically added by Stale bot label Dec 30, 2020
@mikehardy
Copy link
Collaborator

You may also like this, it's slowly grown more full-featured and it is what we use internally when we jest test the module itself

https://github.com/invertase/react-native-firebase/blob/master/jest.setup.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help: needs-triage Issue needs additional investigation/triaging. type: bug New bug report
Projects
None yet
Development

No branches or pull requests

3 participants