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

'NSInternalInconsistencyException', reason: 'You must override the supportedEvents method of WEGN_RNFirebaseNotifications' #1

Closed
john1jan opened this issue Jul 3, 2018 · 17 comments
Assignees

Comments

@john1jan
Copy link

john1jan commented Jul 3, 2018

'NSInternalInconsistencyException', reason: 'You must override the supportedEvents method of WEGN_RNFirebaseNotifications'

Got this error when running on ios

@uzma-sayyed
Copy link
Contributor

@john1jan can you please provide more information on what action you are getting this error and how to reproduce it?

@Rajat421
Copy link

Rajat421 commented Jul 18, 2018

@uzma-sayyed I am getting this error at runtime whenever I add WEGLicensecode in Info-plist.

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'You must override the supportedEvents method of WEGN_RNFirebaseNotifications'
*** First throw call stack:
(
0 CoreFoundation 0x000000010bab81e6 _exceptionPreprocess + 294
1 libobjc.A.dylib 0x000000010a43e031 objc_exception_throw + 48
2 CoreFoundation 0x000000010babd472 +[NSException raise:format:arguments:] + 98
3 Foundation 0x000000010588864f -[NSAssertionHandler handleFailureInFunction:file:lineNumber:description:] + 165
4 GrowwStage 0x0000000102d75455 +[RCTEventEmitter initialize] + 325
5 libobjc.A.dylib 0x000000010a43eb04 CALLING_SOME
+initialize_METHOD + 19
6 libobjc.A.dylib 0x000000010a43ee9e _class_initialize + 276
7 libobjc.A.dylib 0x000000010a43c2f3 object_setClass + 90
8 WebEngage 0x000000010929d38e +[WEGDelegateProxy dynamicallySubclassAppDelegate:forProtocol:] + 2926
9 WebEngage 0x0000000109261fbe -[WebEngage swizzleUserNotificationCenterDelegate:] + 286
10 WebEngage 0x0000000109261e11 -[WebEngage observeValueForKeyPath:ofObject:change:context:] + 641
11 Foundation 0x00000001057c4820 NSKeyValueNotifyObserver + 349
12 Foundation 0x00000001057c40d7 NSKeyValueDidChange + 483
13 Foundation 0x00000001058a522b -[NSObject(NSKeyValueObservingPrivate) _changeValueForKeys:count:maybeOldValuesDict:usingBlock:] + 778
14 Foundation 0x00000001057911b4 -[NSObject(NSKeyValueObservingPrivate) _changeValueForKey:key:key:usingBlock:] + 61
15 Foundation 0x00000001057edb79 _NSSetObjectValueAndNotify + 255
16 GrowwStage 0x00000001031a14f6 -[RNFirebaseNotifications initialise] + 118
17 GrowwStage 0x00000001031a1450 -[RNFirebaseNotifications init] + 128
18 GrowwStage 0x0000000102dac894 __44-[RCTModuleData initWithModuleClass:bridge:]_block_invoke + 36
19 GrowwStage 0x0000000102dad3c2 -[RCTModuleData setUpInstanceAndBridge] + 1762
20 GrowwStage 0x0000000102daf0c6 __25-[RCTModuleData instance]_block_invoke + 38
21 GrowwStage 0x0000000102de3463 RCTUnsafeExecuteOnMainQueueSync + 67
22 GrowwStage 0x0000000102daedd2 -[RCTModuleData instance] + 754
23 GrowwStage 0x0000000102cfa838 __49-[RCTCxxBridge _prepareModulesWithDispatchGroup:]_block_invoke + 200
24 libdispatch.dylib 0x000000010d02c7ab _dispatch_call_block_and_release + 12
25 libdispatch.dylib 0x000000010d02d7ec _dispatch_client_callout + 8
26 libdispatch.dylib 0x000000010d038a3c _dispatch_main_queue_callback_4CF + 993
27 CoreFoundation 0x000000010ba7ac99 CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 9
28 CoreFoundation 0x000000010ba3eea6 __CFRunLoopRun + 2342
29 CoreFoundation 0x000000010ba3e30b CFRunLoopRunSpecific + 635
30 GraphicsServices 0x000000010f516a73 GSEventRunModal + 62
31 UIKit 0x0000000107094057 UIApplicationMain + 159
32 GrowwStage 0x000000010285d79f main + 111
33 libdyld.dylib 0x000000010d0aa955 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)

@uzma-sayyed
Copy link
Contributor

@Rajat421 there seems to be an issue with method swizzling by Firebase. A similar issue was fixed by them in their recent commit, specifically ced3f44.
Can you try by replacing Firebase's Messaging folder with the above code?

@Rajat421
Copy link

@uzma-sayyed thanks, I have tried this but nothing changed still getting the same error

@sercanov
Copy link

sercanov commented Jul 25, 2018

I also getting same error in Debug mode. Release mode works fine

@uzma-sayyed
Copy link
Contributor

Can you please try solutions given in this thread?

@sercanov
Copy link

sercanov commented Jul 26, 2018

@uzma-sayyed the solutions in that thread suggests editing the module, I could try that by forking your repository but it wouldn't it be better you to update it ?

Edit: By the way WEGWebEngageBridge.m already have supportedEvents method which was the suggested solutions of the tread, i think the problem is something else. I'll be looking into it

@saumitrabhave
Copy link

I have created facebook/react-native#20687 in React native , In the meantime (To temporarily fix crash) you can define NS_BLOCK_ASSERTIONS flag in Preprocessor Macros. You can do so by going to Build Target -> Build Settings -> Preprocessor Macros (Define for Debug).

Hope this helps.

@sercanov
Copy link

Any updates ? It is still crashing on debug mode, I have to comment out WebEngage initialize code every time

@saumitrabhave
Copy link

Hi @sercanov , Did you try the workaround shared in in comment above? Does it solve the issue for you in debug mode

@sercanov
Copy link

sercanov commented Oct 5, 2018

Hey @saumitrabhave
I added NS_BLOCK_ASSERTIONS=1 to Preprocessor Macros but it is still crashing

018-10-05 11:47:19.660073+0300 ] - [7446:1636090] -[WEGConfig initWithLuid:andCuid:] [Line 74] ERROR: Could Not create dataHolderContext Error Domain=NSCocoaErrorDomain Code=3840 "Cannot parse a NULL or zero-length data" UserInfo={NSDebugDescription=Cannot parse a NULL or zero-length data}
2018-10-05 11:47:19.668033+0300 - [7446:1636090] *** Assertion failure in +[RCTEventEmitter initialize](), /Users/sercanov/Projects/rider/node_modules/react-native/React/Modules/RCTEventEmitter.m:27
2018-10-05 11:47:19.669167+0300 - [7446:1636090] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'You must override the `supportedEvents` method of WEGN_RNFirebaseNotifications'

@rajatbeck
Copy link

Facing the same issue , i have tried all the above mentioned solutions no success ,as this ticket is still open have you guys come up with any other solution?

@saumitrabhave
Copy link

Hi, There is an open issue at facebook/react-native#21333 , I don't think we can do much here. Did you try adding the flag as Preprocessor Macro for eg. https://stackoverflow.com/questions/30080466/disable-assertions-while-testing

@cayleyh
Copy link

cayleyh commented Nov 20, 2018

I'm getting this as well. I've tried adding the debug flag & it still doesn't work. In my case it looks like RNFirebaseNotifications initialize is triggering an observer in the WebEngage SDK that then tries to swizzle UserNotificationCenterDelegate (attached call stack).

However in my case, I'm NOT using the react-native-webengage package. I'm trying to use the native iOS SDK in the native only side of a mixed project where I DON'T want to control WebEngage via react native code.

screen shot 2018-11-20 at 1 02 50 pm

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'You must override the `supportedEvents` method of WEGN_RNFirebaseNotifications'
*** First throw call stack:
(0x18ef06fe0 0x18d968538 0x18ef06eb4 0x18f99f7cc 0x1003929e0 0x18d969418 0x18d969684 0x18d9666d8 0x101bf3c60 0x101bba3f0 0x101bba1f4 0x18f90cd08 0x18f90c830 0x18f9c3ac8 0x18f90bce4 0x18f930030 0x10063987c 0x1006397cc 0x1003c6ec0 0x1003c78c0 0x1003c93a4 0x1003f6120 0x1003c90d8 0x100322d7c 0x1020e9a50 0x1020e9a10 0x1020ee8b0 0x18eeb50c8 0x18eeb2ce4 0x18ede2da4 0x19084d074 0x19509dc9c 0x1000f48e0 0x18ddf159c)
libc++abi.dylib: terminating with uncaught exception of type NSException

@ygit
Copy link
Contributor

ygit commented Apr 12, 2019

This was a pretty complicated issue to debug & resolve. We have released a fix for this in WebEngage iOS SDK version 4.5.0

@ghost
Copy link

ghost commented Oct 16, 2019

I am getting error with react-native (0.60.4) and WebEngage (4.9.9)

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'You must override the supportedEvents method of WEGN_RNFirebaseNotifications'

@ygit
Copy link
Contributor

ygit commented Oct 16, 2019

@shafips Implement the steps mentioned on WebEngage Documentation for Disable Swizzling.

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

9 participants