pendo-io/pendo-mobile-sdk

react native iOS 12 crash with new pendo sdk

Closed this issue · 10 comments

Platform + Version
iOS 12

SDK Version
Pendo 3.0.0

Framework
React Native using React Navigation,

Describe the bug

Recently we update the sdk to v3 and some users that have iPhone 6 report crashes.
We prepare a setup with:

  • MacOS 12.7.3 Monterrey
  • Xcode 14.1
  • React Native 0.72.9
  • rn-pendo-sdk 3.0.0
  • iPhone 6 simulator with iOS 12.4

To Reproduce
Steps to reproduce the behavior:

  1. Go to app on iPhone 6 with iOS 12
  2. App crashes

Expected behavior
App init normally and connect with metro server.

Logs
If applicable, please add crash logs OR pendo logs (can be turned on with PendoManager.shared().setDebugMode(true))

Video of the app crashing:

Simulator.Screen.Recording.-.iPhone.6.-.2024-02-12.at.17.14.31.mp4

Capture of crash dialog:

Captura de Pantalla 2024-02-12 a la(s) 17 14 41

Some Xcode logs:

dyld: Library not loaded: /System/Library/Frameworks/SwiftUI.framework/SwiftUI
  Referenced from: /Users/joeltorrejon/Library/Developer/CoreSimulator/Devices/CC105560-CF09-4CDF-89B1-E0739D7D6494/data/Containers/Bundle/Application/A8DA2F6B-B943-49A9-8162-B208DBEB5069/AgendaPro simulator.app/Frameworks/Pendo.framework/Pendo
  Reason: image not found
dyld: launch, loading dependent libraries
DYLD_FRAMEWORK_PATH=/Users/joeltorrejon/Library/Developer/Xcode/DerivedData/AgendaPro-dvkivgigmcgybrgfoanwvldvkiub/Build/Products/Debug-iphonesimulator
DYLD_FALLBACK_LIBRARY_PATH=/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 12.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib
DYLD_ROOT_PATH=/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 12.4.simruntime/Contents/Resources/RuntimeRoot
DYLD_FALLBACK_FRAMEWORK_PATH=/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 12.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks
DYLD_INSERT_LIBRARIES=/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 12.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libBacktraceRecording.dylib:/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 12.4.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libMainThreadChecker.dylib:/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 12.4.simruntime/Contents/Resources/RuntimeRoot/Developer/Library/P
(lldb) 

Sample Code
Code snippet or Sample project

Additional context
Add any other context about the problem here.

@jgtorrejon
We r looking into it

Same issue with React Native 0.73.4. Crashes on all iOS devices (Debug and Release). Very rarely it works (1 in 20 times).

EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000020

Crashed: com.apple.main-thread
0  libobjc.A.dylib                0x25668 objc_retain + 8
1  libsystem_blocks.dylib         0x11b6 _call_copy_helpers_excp + 74
2  libsystem_blocks.dylib         0x1d8a _Block_copy + 306
3  libobjc.A.dylib                0x20347 objc_setProperty_nonatomic_copy + 36
4  Pendo                          0x147b27 -[PNDDebouncer call:] + 31
5  Pendo                          0x153190 __32-[NSObject(RNPendo) requestScan]_block_invoke + 84
6  libdispatch.dylib              0x1a90 _dispatch_call_block_and_release + 12
7  libdispatch.dylib              0x2d3a _dispatch_client_callout + 8
8  libdispatch.dylib              0x11ac0 _dispatch_main_queue_drain + 1420
9  libdispatch.dylib              0x11526 _dispatch_main_queue_callback_4CF + 31
10 CoreFoundation                 0x8ddc4 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
11 CoreFoundation                 0x886ff __CFRunLoopRun + 2463
12 CoreFoundation                 0x8797d CFRunLoopRunSpecific + 557
13 GraphicsServices               0x308f GSEventRunModal + 137
14 UIKitCore                      0xffd53d -[UIApplication _run] + 972
15 UIKitCore                      0x1001fab UIApplicationMain + 123
16 evolve_v1                      0x4a19 main + 7 (main.m:7)
17 ???                            0x10f2023e0 (Missing)
18 ???                            0x206a7d386 (Missing)`]([url](url))

@sanjeev-karat
Your stack trace is from different crash. The initial issue was caused by not loading SwiftUI lib. Your issue is different. Any chance you can open a new ticket with steps how to reproduce it, and if possible with full crash log from Apple and maybe sample code/app so we could reproduce it

@jgtorrejon
I think (pretty sure )we have a solution.(Must admit I am not sure why we didnt implement it like that in the first place) Unfortunately I cant properly test it as I cant download such old simulator, the older Xcode version that I have is Xcode14, which doesnt allow me to download IOS12 simulators. I tried to download Xcode 13 but it was crashing on my Mac. We still keep iOS devices with old os version so we will be able to verify the solution only next week.
I would also suspect that this crash might accrue on devices so that will be a HF from our side.
If you think the issue is urgent for you I can send you a custom SDK build with that fix until we have a proper release

Hi @MikePendo, we have a setup to test it, would be great to have a SDK to prove it, my email is felipefont@agendapro.com

@jgtorrejon
just sent u an email

@jgtorrejon
3.1.1 sdk was just released, the crash should be fixed. (please see that you fetch the 3.1.1 native)

I am also experiencing this issue with development mode enabled even with 3.1.1

[rn-pendo-sdk] React Navigation Init.
ERROR The 'navigation' object hasn't been initialized yet. This might happen if you don't have a navigator mounted, or if the navigator hasn't finished mounting. See https://reactnavigation.org/docs/navigating-without-navigation-prop#handling-initialization for more details.

it was working fine without pendo setup, but now I am getting this error once I switched NavigationContainer to Pendo navigation container.

import * as React from 'react';
import RootNavigation from './RootNavigation';
import analytics from '@react-native-firebase/analytics';
import {NavigationContainer} from '@react-navigation/native';
import {WithPendoReactNavigation} from 'rn-pendo-sdk';
import {navigationRef} from './NavigationService';

const NavigationSetup = () => {
  const routeNameRef = React.useRef();
  const PendoNavigationContainer =
    WithPendoReactNavigation(NavigationContainer);

  return (
    <React.Fragment>
      <PendoNavigationContainer
        ref={navigationRef}
        onReady={() => {
          routeNameRef.current = navigationRef.current.getCurrentRoute().name;
        }}
        onStateChange={async () => {
          const previousRouteName = routeNameRef.current;
          const currentRouteName = navigationRef.current.getCurrentRoute().name;

          if (previousRouteName !== currentRouteName) {
            await analytics().logScreenView({
              screen_name: currentRouteName,
              screen_class: currentRouteName,
            });
          }
          routeNameRef.current = currentRouteName;
        }}>
        <RootNavigation />
      </PendoNavigationContainer>
    </React.Fragment>
  );
};

export default NavigationSetup;
 

@nvacheishvili
its not the same issue