react-native-detector icon indicating copy to clipboard operation
react-native-detector copied to clipboard

iOS app crashing after 0.2.2 Upgrade

Open connorpmullins opened this issue 2 years ago • 5 comments

Apologies in advance - this is a less-helpful issue report than I would like to make.

After upgrading react-native-detector to v0.2.2, our iOS app is crashing on launch with the error Invariant Violation: Native module cannot be null.

After downgrading back to v0.2.1, the issue was immediately resolved.

It's not pressing for us to get this fixed, and I don't expect help without me providing more information. I just want to open this issue as a central place for others to report on it if they have the same problem.

connorpmullins avatar Mar 23 '22 12:03 connorpmullins

I see that this is due to the change in the NativeEventEmitter initialization. https://github.com/AzizAK/react-native-detector/compare/v0.2.1...v0.2.2#diff-0b5adbfe7b36e4ae2f479291e20152e33e940f7f265162d77f40f6bdb5da7405L9

From the react-native docs the first argument of the NativeEventEmitter constructor is required on iOS:

Params:
nativeModule – the NativeModule implementation. This is required on IOS and will throw an invariant error if undefined.

So I am curious why this change was made.

aamikus avatar Mar 25 '22 10:03 aamikus

Yeah I am having the same issue

qzaid avatar Mar 25 '22 19:03 qzaid

Apologies in advance - this is a less-helpful issue report than I would like to make.

After upgrading react-native-detector to v0.2.2, our iOS app is crashing on launch with the error Invariant Violation: Native module cannot be null.

After downgrading back to v0.2.1, the issue was immediately resolved.

It's not pressing for us to get this fixed, and I don't expect help without me providing more information. I just want to open this issue as a central place for others to report on it if they have the same problem.

but v0.2.1 have issue in android that it shows message twice like you got a screenshot they fixed this duplicate issue in v0.2.2 but that release has issue in ios which you mentioned

ZaidQ797 avatar Mar 28 '22 13:03 ZaidQ797

just started to use the package and got the error new NativeEventEmitter()` requires a non-null argument, any updates on that ?

Ahmedhamed77 avatar Apr 04 '22 06:04 Ahmedhamed77

same here +1

feraswfares avatar Jul 31 '22 11:07 feraswfares

Issue has been fixed #41 release 0.2.3

AzizAK avatar Aug 20 '22 20:08 AzizAK