didomi / react-native

Didomi SDK for React Native
Other
9 stars 2 forks source link

Crash on Didomi.showPreferences("purposes") #88

Open venum78160 opened 11 months ago

venum78160 commented 11 months ago

I call this when i start the APP:

export async function initDidomi() {
  try {
    const isDidomiReady = await Didomi.isReady()
    if (!isDidomiReady) {
      await Didomi.initialize(
        DIDOMI_KEY_API,
        undefined,
        undefined,
        undefined,
        false,
        undefined,
        DIDOMI_CMP_NVM,
      )
    }
  } catch (error) {
    console.log("Error while checking Didomi readiness:", error)
    Logger.logError("Error while checking Didomi readiness:", error)
  }
}

then i do the showpreferences with this:

  async function showUserPreferences() {
    try {
      const isDidomiReady = await Didomi.isReady()
      if (isDidomiReady) {
        await Didomi.showPreferences()
      } else {
        initDidomi()
        await Didomi.showPreferences()
      }
    } catch (error) {
      console.log("Error showing user preferences:", error)
      Logger.logError("Error showing user preferences:", error)
    }
  }

And sometime the App crash with the error below:

-------------------------------------
Translated Report (Full Report Below)
-------------------------------------

Incident Identifier: 17475472-6F8D-4B5B-AC2C-38220B931DD4
CrashReporter Key:   3ACB4396-D55E-8B9E-E272-2BD969F3CD78
Hardware Model:      Mac14,7
Process:             nvm [12481]
Path:                /Users/USER/Library/Developer/CoreSimulator/Devices/F577EF2A-4F1E-43FC-8C7C-F3D08E9CA732/data/Containers/Bundle/Application/2D0027D9-73FE-4E42-A5ED-B3BB7E9949B4/nvm.app/nvm
Identifier:          com.nicematin.afpmobile.iphone
Version:             4.0.0 (1)
Code Type:           ARM-64 (Native)
Role:                Foreground
Parent Process:      launchd_sim [667]
Coalition:           com.apple.CoreSimulator.SimDevice.F577EF2A-4F1E-43FC-8C7C-F3D08E9CA732 [782]
Responsible Process: SimulatorTrampoline [654]

Date/Time:           2023-09-12 12:01:18.8544 +0200
Launch Time:         2023-09-12 12:00:34.2763 +0200
OS Version:          macOS 13.4.1 (22F82)
Release Type:        User
Report Version:      104

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Triggered by Thread:  0

Last Exception Backtrace:
0   CoreFoundation                         0x180437324 __exceptionPreprocess + 160
1   libobjc.A.dylib                        0x180051274 objc_exception_throw + 56
2   Foundation                             0x180ae2ae8 -[NSMutableDictionary(NSMutableDictionary) classForCoder] + 0
3   nvm                                    0x1035382e0 -[RCTEventEmitter sendEventWithName:body:] + 380 (RCTEventEmitter.m:53)
4   nvm                                    0x10408206c RNDidomi.dispatchEvent(withName:body:) + 396 (RNDidomi.swift:858)
5   nvm                                    0x104094f4c closure #13 in RNDidomi.initEventListener() + 128 (RNDidomi.swift:741)
6   Didomi                                 0x108b0276c 0x1088f4000 + 2156396
7   Didomi                                 0x108a5f820 0x1088f4000 + 1488928
8   Didomi                                 0x108a4688c 0x1088f4000 + 1386636
9   libdispatch.dylib                      0x180132ee4 _dispatch_call_block_and_release + 24
10  libdispatch.dylib                      0x180134708 _dispatch_client_callout + 16
11  libdispatch.dylib                      0x180143fd8 _dispatch_main_queue_drain + 1220
12  libdispatch.dylib                      0x180143b04 _dispatch_main_queue_callback_4CF + 40
13  CoreFoundation                         0x18039a784 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
14  CoreFoundation                         0x180394de4 __CFRunLoopRun + 1912
15  CoreFoundation                         0x180394254 CFRunLoopRunSpecific + 584
16  GraphicsServices                       0x188eb7c9c GSEventRunModal + 160
17  UIKitCore                              0x11a7f2ff0 -[UIApplication _run] + 868
18  UIKitCore                              0x11a7f6f3c UIApplicationMain + 124
19  nvm                                    0x102d462a8 main + 96 (main.m:7)
20  dyld_sim                               0x108281514 start_sim + 20
21  dyld                                   0x1084e9f28 start + 2236
22  ???                              0xf72800000000000 ???

Kernel Triage:
VM - (arg = 0x0) pmap_enter retried due to resource shortage
VM - (arg = 0x0) pmap_enter retried due to resource shortage
VM - (arg = 0x0) pmap_enter retried due to resource shortage

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib                 0x1b17e3fa8 __pthread_kill + 8
1   libsystem_pthread.dylib                0x1b183812c pthread_kill + 256
2   libsystem_c.dylib                      0x18012873c abort + 124
3   libc++abi.dylib                        0x18023d0a8 abort_message + 128
4   libc++abi.dylib                        0x18022dbd4 demangling_terminate_handler() + 300
5   libobjc.A.dylib                        0x180032ea8 _objc_terminate() + 124
6   nvm                                    0x1038f13a4 CPPExceptionTerminate() + 2144 (SentryCrashMonitor_CPPException.cpp:171)
7   libc++abi.dylib                        0x18023c580 std::__terminate(void (*)()) + 12
8   libc++abi.dylib                        0x18023c530 std::terminate() + 52
9   libdispatch.dylib                      0x18013471c _dispatch_client_callout + 36
10  libdispatch.dylib                      0x180143fd8 _dispatch_main_queue_drain + 1220
11  libdispatch.dylib                      0x180143b04 _dispatch_main_queue_callback_4CF + 40
12  CoreFoundation                         0x18039a784 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
13  CoreFoundation                         0x180394de4 __CFRunLoopRun + 1912
14  CoreFoundation                         0x180394254 CFRunLoopRunSpecific + 584
15  GraphicsServices                       0x188eb7c9c GSEventRunModal + 160
16  UIKitCore                              0x11a7f2ff0 -[UIApplication _run] + 868
17  UIKitCore                              0x11a7f6f3c UIApplicationMain + 124
18  nvm                                    0x102d462a8 main + 96 (main.m:7)
19  dyld_sim                               0x108281514 start_sim + 20
20  dyld                                   0x1084e9f28 start + 2236

Version: "@didomi/react-native@^1.18.0": react-native@0.71.8: IOS 16.4

felipe-saez commented 11 months ago

Hello, could you please tell me what device this crash report comes from? Under hardware model I see Mac14,7 and under OS version I see macOS 13.4.1 but at the end of your message you specify iOS 16.4.

Kind regards

venum78160 commented 11 months ago

Hello, we have generated an iOS 16.4 version IOS phone on a simulator and this simulator runs on a Mac. Does this answer your question?

felipe-saez commented 11 months ago

Hello, yes, that answers my question, thanks. Would you be able to reproduce the same crash from a test device? Currently the Crash Report attached to this issue is not fully symbolicated so it's hard to see what went wrong (see lines 6 to 8). I'd suggest to get a Crash Report from a test device to see if we can get it fully symbolicated.

Kind regards