Answered

The app crashes on React-Native 0.70.6

  • 28 December 2022
  • 5 replies
  • 1259 views

After updating to new RN, everything was fine, but when i updated Intercom, the app has been starting close after open, and rn console was clean... But i found problem in xCode:

2022-12-27 22:31:47.367063-0600 MyApp[83087:2986586] [Intercom] ERROR - Tried to update user, but no user has been registered yet.
 
2022-12-27 22:31:47.367854-0600 MyApp[83087:2986586] [Intercom] ERROR - Tried to send metrics, but no user has been registered yet.
 
2022-12-27 22:31:47.368022-0600 MyApp[83087:2986586] -[NSNull code]: unrecognized selector sent to instance 0x1b9554020
 
2022-12-27 22:31:47.372064-0600 MyApp[83087:2986586] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSNull code]: unrecognized selector sent to instance 0x1b9554020'
 
**** First throw call stack:**
 
(
 
0 CoreFoundation 0x000000018040e7ec __exceptionPreprocess + 172
 
1 libobjc.A.dylib 0x0000000180051144 objc_exception_throw + 56
 
2 CoreFoundation 0x000000018041d49c +[NSObject(NSObject) instanceMethodSignatureForSelector:] + 0
 
3 CoreFoundation 0x00000001804126ec forwarding + 1308
 
4 CoreFoundation 0x0000000180414b6c _CF_forwarding_prep_0 + 92
 
5 MyApp 0x0000000104d2b7dc RCTJSErrorFromCodeMessageAndNSError + 696
 
6 MyApp 0x0000000104d2b4e4 RCTJSErrorFromNSError + 236
 
7 MyApp 0x0000000104cc8454 __41-[RCTModuleMethod processMethodSignature]_block_invoke_4.56 + 132
 
8 MyApp 0x0000000105176908 __51-[IntercomModule updateUser:resolver:failureBlock:]_block_invoke_2 + 72
 
9 Intercom 0x000000010979c958 shouldRenderOnNewLine + 29592
 
10 Intercom 0x0000000109770ff0 IntercomSDK_PINRemoteImageManagerSubclassOverridesSelector + 224848
 
11 Intercom 0x000000010977122c IntercomSDK_PINRemoteImageManagerSubclassOverridesSelector + 225420
 
12 Intercom 0x000000010976b6c0 IntercomSDK_PINRemoteImageManagerSubclassOverridesSelector + 202016
 
13 Intercom 0x000000010979c694 shouldRenderOnNewLine + 28884
 
14 Intercom 0x0000000109789cd0 IntercomSDK_PINRemoteImageManagerSubclassOverridesSelector + 326448
 
15 libdispatch.dylib 0x000000010a3c8594 _dispatch_call_block_and_release + 24
 
16 libdispatch.dylib 0x000000010a3c9d5c _dispatch_client_callout + 16
 
17 libdispatch.dylib 0x000000010a3da808 _dispatch_main_queue_drain + 1316
 
18 libdispatch.dylib 0x000000010a3da2d4 _dispatch_main_queue_callback_4CF + 40
 
19 CoreFoundation 0x0000000180372cf4 CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 12
 
20 CoreFoundation 0x000000018036d3b0 __CFRunLoopRun + 1956
 
21 CoreFoundation 0x000000018036c7f4 CFRunLoopRunSpecific + 584
 
22 GraphicsServices 0x0000000188faec98 GSEventRunModal + 160
 
23 UIKitCore 0x0000000115c6c5d4 -[UIApplication _run] + 868
 
24 UIKitCore 0x0000000115c705cc UIApplicationMain + 124
 
25 MyApp 0x00000001044a122c main + 96
 
26 dyld 0x000000010910dfa0 start_sim + 20
 
27 ??? 0x0000000108e79e50 0x0 + 4444364368
 
28 ??? 0x5d0c800000000000 0x0 + 6704874682736181248
 
)
 
libc++abi: terminating with uncaught exception of type NSException
 
terminating with uncaught exception of type NSException
 
** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSNull code]: unrecognized selector sent to instance 0x1b9554020'

When i removed Intercom, the app repairs and no problem.

Dep:
"react": "18.2.0",
"react-native": "0.70.6",
"@intercom/intercom-react-native": "4.0.1",
 
Pods:
- Intercom (14.0.0)
- intercom-react-native (4.0.1):
- Intercom (~> 14.0.0)
- React-Core

Actually i tried 0.70-0.70.6 , changed Intercom sdk to 14.0.5, delete library and install again, remove deprecated methods (from @intercom/intercom-react-native3.0.5), clean cache etc -- nothing changed.

Also, i'm m1 user, may be it could help.

icon

Best answer by Brian B11 3 October 2023, 17:53

View original

5 replies

Userlevel 2

Hey @vladislav​! Daniel from Customer Support Engineering here 🔧 

 

Could you please contact us via the Messenger about this issue? It could be related to the code of your app, or it could be something related to a recent update we've made. I will update the thread here if there's anything we can share publicly, but for now, let's triage the issue 1:1 in case we need any sensitive info 👍 When you write in, could you please confirm the device model and iOS version this was tested on? Thanks! 😁

i'm using iPhone 14 / ios 16.1

also i'm using

COCOAPODS: 1.11.3

 

Fixed, the problem was in identify users -- native intercom sdk immediately crash the app, if you try to use some method and you are not registered. Use this methods BEFORE using others.

Intercom.loginUnidentifiedUser()
Intercom.loginUserWithUserAttributes({email:'bob@example.com',userId:'bob-123'})

This method works very very weird =>

Intercom.logout()

Why? => if you, for example, for some reason, failed with your register, and sign to the app, then you logout (and use method above) => you will crash.

 

Please, make better implementation for it, make logs for RN console -- this could save a LOT of time for developers.

Userlevel 2
Badge +2

Hi

This has been fixed in [Release 6.0.1](https://github.com/intercom/intercom-react-native/releases/tag/6.0.1)

Thanks

Reply