Instabug / Instabug-React-Native

In-app feedback and bug reporting tool for React Native
https://instabug.com/platforms/react-native
MIT License
304 stars 100 forks source link

Crash on app start on IOS - object cannot be nil #1238

Closed niktonic21 closed 6 days ago

niktonic21 commented 2 weeks ago

Sometimes when app is the background and is opened again, the app start crashing and have to be reinstalled.

Steps to Reproduce the Problem

Leave the app in the background for 2-3 mins Open again.

Expected Behavior

No crash.

Actual Behavior

App start crashing and have to be reinstaled.

Instabug integration code

const initialiseInstabug = () => {
  Instabug.init({
    token: config.instabugAppToken,
    invocationEvents: [InvocationEvent.shake],
    debugLogsLevel: LogLevel.verbose,
  });

  // Extended reporting options for testers
  BugReporting.setExtendedBugReportMode(
    ExtendedBugReportMode.enabledWithOptionalFields,
  );
  Navigation.events() // Link RNN to instabug so that we can have repro steps
    .registerComponentDidAppearListener(Instabug.componentDidAppearListener);

  Instabug.setWelcomeMessageMode(WelcomeMessageMode.disabled);
  Instabug.setReproStepsConfig({ all: ReproStepsMode.enabled });
  Instabug.setSessionProfilerEnabled(true);
};

After login we have: Instabug.identifyUser(email, name, id);

SDK Version

Same crash on 13.1.1 and 12.7.0

React Native, iOS and Android Versions

RN: 0.73.7 iOS: 17.x.x (e.g. 17.5.1)

Device Model

iPone 12 pro, iPhone 16 pro

Crash log

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Reason: *** -[__NSArrayM insertObject:atIndex:]: object cannot be nil
Triggered by Thread:  12

Last Exception Backtrace:
0   CoreFoundation                  0x191800f20 __exceptionPreprocess + 164 (NSException.m:249)
1   libobjc.A.dylib                 0x1896ae018 objc_exception_throw + 60 (objc-exception.mm:356)
2   CoreFoundation                  0x19179fb60 -[__NSArrayM insertObject:atIndex:] + 1296 (NSArrayM.m:164)
3   Instabug                        0x103f072c4 __80-[IBGUserRepository deleteUsersAboveCountThresholdExceptUUID:completionHandler:]_block_invoke + 392
4   Instabug                        0x10400b744 __70-[IBGDALService writeASyncAfterCoreDataIntialization:completionBlock:]_block_invoke_3 + 52
5   CoreData                        0x1998f10dc developerSubmittedBlockToNSManagedObjectContextPerform + 156 (NSManagedObjectContext.m:3985)
6   libdispatch.dylib               0x1996a5dd4 _dispatch_client_callout + 20 (object.m:576)
7   libdispatch.dylib               0x1996ad400 _dispatch_lane_serial_drain + 748 (queue.c:3900)
8   libdispatch.dylib               0x1996adf30 _dispatch_lane_invoke + 380 (queue.c:3991)
9   libdispatch.dylib               0x1996b8cb4 _dispatch_root_queue_drain_deferred_wlh + 288 (queue.c:6998)
10  libdispatch.dylib               0x1996b8528 _dispatch_workloop_worker_thread + 404 (queue.c:6592)
11  libsystem_pthread.dylib         0x1ee657934 _pthread_wqthread + 288 (pthread.c:2696)
12  libsystem_pthread.dylib         0x1ee6540cc start_wqthread + 8 (:-1)
stale[bot] commented 1 week ago

This issue has been automatically marked as pending feedback because we need additional information to be able to investigate it further. It will be closed in 7 days if it remains inactive. Thank you for your contributions.

stale[bot] commented 6 days ago

This issue has been automatically closed since we haven't heard back from you. Please feel free to re-open the issue if you have more information to add.