Skip to main content
Answered

Why does my React Native app keep crashing on iOS?


  • Connector
  • 6 replies

Hey I'm trying to integrate Intercom with the current React Native app we're working on and while it's working perfectly fine on Android, the iOS keeps crashing.

 

Here are the error details:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[Intercom setReactNativeVersion:]: unrecognized selector sent to class 0x112eaf318'
terminating with uncaught exception of type NSException

P.S. I tried adding "react native" as one of the forum question topics but it wasn't available. 

Best answer by Eric Fitz

It looks like you have version 10.0.0 of the Intercom iOS SDK bundled in the React Native wrapper. You need to run version 10.0.1. By running 

`pod update Intercom` in the iOS directory in our React Native plugin, this will fetch the correct Intercom iOS SDK for you. If you try running your app again after doing this, the error should be gone.

View original
Did this topic help you find an answer to your question?

15 replies

Eric Fitz
Employee
Forum|alt.badge.img+5
  • Employee
  • 1630 replies
  • August 3, 2021

Hey @spud​, just to confirm that you're using our official React Native SDK for this?


  • Author
  • Connector
  • 6 replies
  • August 3, 2021

Eric Fitz
Employee
Forum|alt.badge.img+5
  • Employee
  • 1630 replies
  • August 4, 2021

Thanks for confirming that for me! What version of Cocoapods are you using?


  • Author
  • Connector
  • 6 replies
  • August 4, 2021

I am using gem version 1.10.1.


Eric Fitz
Employee
Forum|alt.badge.img+5
  • Employee
  • 1630 replies
  • Answer
  • August 5, 2021

It looks like you have version 10.0.0 of the Intercom iOS SDK bundled in the React Native wrapper. You need to run version 10.0.1. By running 

`pod update Intercom` in the iOS directory in our React Native plugin, this will fetch the correct Intercom iOS SDK for you. If you try running your app again after doing this, the error should be gone.


  • Author
  • Connector
  • 6 replies
  • August 9, 2021

I updated the pod, however it did not solve my problem. Here are the versions of Intercom used in the Podfile.lock:

- Intercom (10.0.3)
- intercom-react-native (1.0.3):
- Intercom (~> 10.0)
- React-Core

 


  • Author
  • Connector
  • 6 replies
  • August 9, 2021

I looked at the "intercom-react-native.podspec" in the intercom react-native GitHub repository and at the bottom of the file, it sets the dependency to 10.0.

Link:

intercom-react-native/intercom-react-native.podspec at main · intercom/intercom-react-native (github.com)


  • Author
  • Connector
  • 6 replies
  • August 9, 2021

Update: updating the s.dependency for Intercom to 10.0.1 or 10.0.3 did not solve the problem.

 


Eric Fitz
Employee
Forum|alt.badge.img+5
  • Employee
  • 1630 replies
  • August 10, 2021

Hey @spud​, can you also link to the GitHub code block where you've experienced this after updating to 10.0.1 and 10.0.3?


  • Author
  • Connector
  • 6 replies
  • August 12, 2021
#5 0x0000000101738414 in +[IntercomModule initialize:withAppId:] at /Users/Unfocused/Documents/Projects/SpudApp/node_modules/@intercom/intercom-react-native/ios/IntercomModule.m:41

 

#6 0x0000000100d75828 in -[AppDelegate application:didFinishLaunchingWithOptions:] at /Users/Unfocused/Documents/Projects/SpudApp/ios/SpudApp/AppDelegate.m:58

 

[IntercomModule initialize:@"KEY IS HERE" withAppId:@"APP ID IS HERE"];

 

 

That's as far as the stack trace goes in the swift/objc code, the rest is assembly instructions

 

In the library, it crashes here:

[Intercom setReactNativeVersion:version]; <-- This line

Intercom setApiKey:apiKey forAppId:appId];

 

Line 41 of IntercomModule.m

 

It works if I manually put my information in the example build from your GitHub so this leads me to believe it is related to the build_frameworks.sh build script.

 

Unrecognized selector in this case I believe refers to the fact that the header file or somewhere in the code it says the function exists but it is not defined anywhere and so it crashes. Seems like an issue with the library generated for release.

 

Those are my initial thoughts. Would love to hear your thoughts on this!


  • Connector
  • 5 replies
  • September 7, 2021

Having the same issue with intercom-react-native (1.0.5) and Intercom 10.1.x.

With debugging I can see that a value is passed to `setReactNativeVersion`.

Commenting out setReactNativeVersion stops the crash.


  • New Participant
  • 2 replies
  • September 27, 2021

Any update about this? I have the same problem.

I followed the installation guide (https://developers.intercom.com/installing-intercom/docs/react-native-installation and I can build it for Android (and chat is working), but not for iOS.

Exception NSException * "+[Intercom setReactNativeVersion:]: unrecognized selector sent to class 0x110951720" 0x0000600000f19830

Podfile.lock:

- React (0.63.3):
...
- Intercom (10.1.4)
- intercom-react-native (1.0.5):
- Intercom (~> 10.1.0)
- React-Core

 


Eric Fitz
Employee
Forum|alt.badge.img+5
  • Employee
  • 1630 replies
  • September 28, 2021

Hey @user800​, other customers experienced this issue reported that running the most recent version of our React Native SDK and clearing their cache resolved the issue. Can you advise if you've followed both of these steps?


  • New Participant
  • 2 replies
  • September 28, 2021

@eric f11​ Yes I followed both of them. Isn't my version the latest?

Where can I find these other users' comments or any other help?


Eric Fitz
Employee
Forum|alt.badge.img+5
  • Employee
  • 1630 replies
  • September 29, 2021

@user800​, this solution was presented to me by our Mobile team directly. I would advise you to contact our Support team directly about this issue - you can message them through the Messenger on your Intercom workspace. Please let me know when you've done this and I'll make sure that your conversation is routed correctly.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings