Error with Initialized MobileRTC using bridging to swift

Description
I have error with try initialize MobileRTC.shared() with MobileRTCSDKInitContext()

code:

        let context = MobileRTCSDKInitContext()

        context.domain = "https://zoom.us"
        context.enableLog = true
        context.locale = .default
        context.appGroupId = ""

        MobileRTC.shared().initialize(context)

        let auth: MobileRTCAuthService = zoom.getAuthService()!
        auth.clientKey = "XXXXXXXXXXXXXXXX"
        auth.clientSecret = "XXXXXXXXXXXXXXXX"
        auth.delegate = self
        auth.sdkAuth()

I recibe this error:

ZoomIntegration[3162:824279] *** Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘*** -[NSBundle initWithURL:]: nil URL argument’
*** First throw call stack:
(0x19bbe5654 0x19b907bcc 0x19beeea54 0x19beee948 0x104fe3374 0x104e0b730 0x104e0d044 0x104fe329c 0x1054b6c04 0x105a33bd4 0x105910540 0x1054833fc 0x105736860 0x105735a78 0x1057333c4 0x105734544 0x104ff1a1c 0x10514fc50 0x104bdd410 0x104bdd8ec 0x19fc8fc14 0x19fc919a0 0x19fc9723c 0x19f43ba6c 0x19fc93280 0x19fc935d4 0x19fc993e4 0x104bdeeb4 0x19b9e58f0)
libc++abi.dylib: terminating with uncaught exception of type NSException

Which version
zoom-sdk-ios
Version: v5.0.24433.0616
Xcode: 11.6**

Smartphone:

  • Device: iPhone 7
  • OS: iOS 13.6

Hi @SergioDalenceA,

Thanks for the post. Could you provide the full .crash log for us to further investigate?

Thanks!

Hi Carson_Chen this is my .crash log

Incident Identifier: 06CAE921-293F-4E16-BC7A-7E8C218C4536
CrashReporter Key: 96445500ade5ccdcf98736a55eeb8a8758ae1e7d
Hardware Model: iPhone9,3
Process: ZoomIntegration [2522]
Path: /private/var/containers/Bundle/Application/C34DB900-AFCD-4F33-846F-FB167893C066/ZoomIntegration.app/ZoomIntegration
Identifier: com.sd.ZoomIntegration
Version: 1 (1.0)
Code Type: ARM-64 (Native)
Role: Foreground
Parent Process: launchd [1]
Coalition: com.sd.ZoomIntegration [1543]

Date/Time: 2020-08-11 17:46:31.6050 -0400
Launch Time: 2020-08-11 17:46:31.5192 -0400
OS Version: iPhone OS 13.6 (17G68)
Release Type: User
Baseband Version: 4.03.00
Report Version: 104

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

Last Exception Backtrace:
0 CoreFoundation 0x194ced654 __exceptionPreprocess + 224
1 libobjc.A.dylib 0x194a0fbcc objc_exception_throw + 55
2 Foundation 0x194ff6a54 -[NSBundle initWithURL:] + 255
3 Foundation 0x194ff6948 +[NSBundle bundleWithURL:] + 35
4 MobileRTC 0x104f57374 0x104f44000 + 78708
5 libdispatch.dylib 0x1949b3524 _dispatch_client_callout + 15
6 libdispatch.dylib 0x19495adc8 _dispatch_once_callout + 27
7 MobileRTC 0x104f5729c 0x104f44000 + 78492
8 MobileRTC 0x10542ac04 0x104f44000 + 5139460
9 MobileRTC 0x1059a7bd4 0x104f44000 + 10894292
10 MobileRTC 0x105884540 0x104f44000 + 9700672
11 MobileRTC 0x1053f73fc 0x104f44000 + 4928508
12 MobileRTC 0x1056aa860 0x104f44000 + 7759968
13 MobileRTC 0x1056a9a78 0x104f44000 + 7756408
14 MobileRTC 0x1056a73c4 0x104f44000 + 7746500
15 MobileRTC 0x1056a8544 0x104f44000 + 7750980
16 MobileRTC 0x104f65a1c 0x104f44000 + 137756
17 MobileRTC 0x1050c3c50 0x104f44000 + 1571920
18 ZoomIntegration 0x104bacf48 0x104ba8000 + 20296
19 ZoomIntegration 0x104bad424 0x104ba8000 + 21540
20 UIKitCore 0x198d97c14 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 355
21 UIKitCore 0x198d999a0 -[UIApplication _callInitializationDelegatesWithActions:forCanvas:payload:fromOriginatingProcess:] + 5047
22 UIKitCore 0x198d9f23c -[UIApplication _runWithMainScene:transitionContext:completion:] + 1243
23 UIKitCore 0x198543a6c -[_UISceneLifecycleMultiplexer completeApplicationLaunchWithFBSScene:transitionContext:] + 211
24 UIKitCore 0x198d9b280 -[UIApplication _compellApplicationLaunchToCompleteUnconditionally] + 63
25 UIKitCore 0x198d9b5d4 -[UIApplication _run] + 835
26 UIKitCore 0x198da13e4 UIApplicationMain + 1931
27 ZoomIntegration 0x104baeea8 0x104ba8000 + 28328
28 libdyld.dylib 0x194aed8f0 start + 3

Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x0000000194ae2d88 __pthread_kill + 8
1 libsystem_pthread.dylib 0x00000001949fb1e8 pthread_kill$VARIANT$mp + 136
2 libsystem_c.dylib 0x000000019494e934 abort + 100
3 libc++abi.dylib 0x0000000194ab6cc0 __cxxabiv1::__aligned_malloc_with_fallback+ 76992 (unsigned long) + 0
4 libc++abi.dylib 0x0000000194aa8e10 demangling_unexpected_handler+ 19984 () + 0
5 libobjc.A.dylib 0x0000000194a0fe80 _objc_terminate+ 24192 () + 124
6 libc++abi.dylib 0x0000000194ab614c std::__terminate(void (*)+ 74060 ()) + 16
7 libc++abi.dylib 0x0000000194ab60e4 std::terminate+ 73956 () + 44
8 libdispatch.dylib 0x00000001949b3538 _dispatch_client_callout + 36
9 libdispatch.dylib 0x000000019495adc8 _dispatch_once_callout + 28
10 MobileRTC 0x0000000104f5729c 0x104f44000 + 78492
11 MobileRTC 0x000000010542ac04 0x104f44000 + 5139460
12 MobileRTC 0x00000001059a7bd4 0x104f44000 + 10894292
13 MobileRTC 0x0000000105884540 0x104f44000 + 9700672
14 MobileRTC 0x00000001053f73fc 0x104f44000 + 4928508
15 MobileRTC 0x00000001056aa860 0x104f44000 + 7759968
16 MobileRTC 0x00000001056a9a78 0x104f44000 + 7756408
17 MobileRTC 0x00000001056a73c4 0x104f44000 + 7746500
18 MobileRTC 0x00000001056a8544 0x104f44000 + 7750980
19 MobileRTC 0x0000000104f65a1c 0x104f44000 + 137756
20 MobileRTC 0x00000001050c3c50 0x104f44000 + 1571920
21 ZoomIntegration 0x0000000104bacf48 0x104ba8000 + 20296
22 ZoomIntegration 0x0000000104bad424 0x104ba8000 + 21540
23 UIKitCore 0x0000000198d97c14 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 356
24 UIKitCore 0x0000000198d999a0 -[UIApplication _callInitializationDelegatesWithActions:forCanvas:payload:fromOriginatingProcess:] + 5048
25 UIKitCore 0x0000000198d9f23c -[UIApplication _runWithMainScene:transitionContext:completion:] + 1244
26 UIKitCore 0x0000000198543a6c -[_UISceneLifecycleMultiplexer completeApplicationLaunchWithFBSScene:transitionContext:] + 212
27 UIKitCore 0x0000000198d9b280 -[UIApplication _compellApplicationLaunchToCompleteUnconditionally] + 64
28 UIKitCore 0x0000000198d9b5d4 -[UIApplication _run] + 836
29 UIKitCore 0x0000000198da13e4 UIApplicationMain + 1932
30 ZoomIntegration 0x0000000104baeea8 0x104ba8000 + 28328
31 libdyld.dylib 0x0000000194aed8f0 start + 4

Thread 1:
0 libsystem_pthread.dylib 0x0000000194a07738 start_wqthread + 0

Thread 2:
0 libsystem_pthread.dylib 0x0000000194a07738 start_wqthread + 0

Thread 3:
0 libsystem_pthread.dylib 0x0000000194a07738 start_wqthread + 0

Thread 4:
0 libsystem_pthread.dylib 0x0000000194a07738 start_wqthread + 0

Thread 5:
0 libsystem_pthread.dylib 0x0000000194a07738 start_wqthread + 0

Thread 6 name: com.apple.uikit.eventfetch-thread
Thread 6:
0 libsystem_kernel.dylib 0x0000000194ac1198 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x0000000194ac060c mach_msg + 72
2 CoreFoundation 0x0000000194c6b328 __CFRunLoopServiceMachPort + 148
3 CoreFoundation 0x0000000194c6635c __CFRunLoopRun + 1160
4 CoreFoundation 0x0000000194c65ba8 CFRunLoopRunSpecific + 424
5 Foundation 0x0000000194fb701c -[NSRunLoop+ 32796 (NSRunLoop) runMode:beforeDate:] + 228
6 Foundation 0x0000000194fb6efc -[NSRunLoop+ 32508 (NSRunLoop) runUntilDate:] + 88
7 UIKitCore 0x0000000198e4457c -[UIEventFetcher threadMain] + 152
8 Foundation 0x00000001950e5e20 NSThread__start + 848
9 libsystem_pthread.dylib 0x0000000194a03d98 _pthread_start + 156
10 libsystem_pthread.dylib 0x0000000194a0774c thread_start + 8

Thread 7:
0 libsystem_pthread.dylib 0x0000000194a07738 start_wqthread + 0

Thread 8:
0 libsystem_kernel.dylib 0x0000000194ae2b58 __psynch_cvwait + 8
1 libsystem_pthread.dylib 0x00000001949fcce4 _pthread_cond_wait$VARIANT$mp + 680
2 MobileRTC 0x0000000105abd638 0x104f44000 + 12031544
3 MobileRTC 0x0000000105a6ff18 0x104f44000 + 11714328
4 MobileRTC 0x000000010589e124 0x104f44000 + 9806116
5 libsystem_pthread.dylib 0x0000000194a03d98 _pthread_start + 156
6 libsystem_pthread.dylib 0x0000000194a0774c thread_start + 8

Thread 9:
0 libsystem_kernel.dylib 0x0000000194ae2b58 __psynch_cvwait + 8
1 libsystem_pthread.dylib 0x00000001949fcce4 _pthread_cond_wait$VARIANT$mp + 680
2 MobileRTC 0x0000000105abd638 0x104f44000 + 12031544
3 MobileRTC 0x0000000105a74ab0 0x104f44000 + 11733680
4 MobileRTC 0x000000010589e124 0x104f44000 + 9806116
5 libsystem_pthread.dylib 0x0000000194a03d98 _pthread_start + 156
6 libsystem_pthread.dylib 0x0000000194a0774c thread_start + 8

Thread 0 crashed with ARM Thread State (64-bit):
x0: 0x0000000000000000 x1: 0x0000000000000000 x2: 0x0000000000000000 x3: 0x0000000000000000
x4: 0x0000000194ab9f29 x5: 0x000000016b255690 x6: 0x000000000000006e x7: 0xffffffffffffffec
x8: 0x0000000104ed1840 x9: 0x120c430eafc95b54 x10: 0x00000001949fb160 x11: 0x000000000000000b
x12: 0x00000001d066d080 x13: 0x0000000000000001 x14: 0x0000000000000010 x15: 0x0000000000000007
x16: 0x0000000000000148 x17: 0x0000000000000000 x18: 0x0000000000000000 x19: 0x0000000000000006
x20: 0x0000000000000407 x21: 0x000000016b255690 x22: 0x0000000104ed1920 x23: 0x000000016b256d50
x24: 0x0000000000000000 x25: 0x00000001d0b092d6 x26: 0x000000002b870064 x27: 0x0000000000000010
x28: 0x0000000000000000 fp: 0x000000016b2555f0 lr: 0x00000001949fb1e8
sp: 0x000000016b2555d0 pc: 0x0000000194ae2d88 cpsr: 0x40000000
esr: 0x56000080 Address size fault

Hi @SergioDalenceA,

Thanks for the reply and the crash log. Could you verify and see if the MobileRTCResources.bundle is correctly imported into Project>Build Phases>Copy Bundle Resources? It seems this resource bundle is missing.

Thanks!