RosterBuster / rn-zendesk

React Native component for Zendesk
MIT License
17 stars 2 forks source link

Can not launch the Zendesk UI crashes app #7

Open leomercier opened 4 years ago

leomercier commented 4 years ago

Describe the bug

Can not launch the Zendesk UI

Expected behavior Have installed and the app boots up as expected but when the user clicks on the button which calls

RNZendesk.identifyAnonymous("Demo Customer", "demo@cf.com");

                  RNZendesk.showHelpCenter({
                    subject: "Title for any new ticket created by the user inside helpcenter"
                  });```

The app crashes and at the follow errors.

` #import <UIKit/UIKit.h>` **Could not build module 'UIKit'**

2020-04-14 19:29:10.677847+0100 Pura[67047:2188785] Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: ' -[NSArrayM insertObject:atIndex:]: object cannot be nil' *** First throw call stack: ( 0 CoreFoundation 0x00007fff23baa1ee exceptionPreprocess + 350 1 libobjc.A.dylib 0x00007fff50864b20 objc_exception_throw + 48 2 CoreFoundation 0x00007fff23c3cb71 _CFThrowFormattedException + 194 3 CoreFoundation 0x00007fff23c3b683 -[NSArrayM insertObject:atIndex:].cold.1 + 35 4 CoreFoundation 0x00007fff23abd1ff -[NSArrayM insertObject:atIndex:] + 1263 5 ZendeskProviderSDK 0x000000010480d622 42+[ZDKLocalization buildInitialBundleArray]_block_invoke + 232 6 CoreFoundation 0x00007fff23b77fe7 NSARRAY_IS_CALLING_OUT_TO_A_BLOCK + 7 7 CoreFoundation 0x00007fff23abd624 -[NSArrayM enumerateObjectsWithOptions:usingBlock:] + 228 8 ZendeskProviderSDK 0x000000010480d50a +[ZDKLocalization buildInitialBundleArray] + 201 9 ZendeskProviderSDK 0x000000010480db4a 31+[ZDKLocalization setupBundles]_block_invoke + 105 10 libdispatch.dylib 0x000000010596bd6c _dispatch_client_callout + 8 11 libdispatch.dylib 0x000000010596d2bb _dispatch_once_callout + 66 12 ZendeskProviderSDK 0x000000010480dadf +[ZDKLocalization setupBundles] + 86 13 ZendeskProviderSDK 0x000000010480d11b +[ZDKLocalization localizedStringWithKey:] + 52 14 ZendeskSDK 0x0000000104a4ac84 globalinit_33_3809F06811590C3BFF7A94607690EF24_func110 + 100 15 libdispatch.dylib 0x000000010596bd6c _dispatch_client_callout + 8 16 libdispatch.dylib 0x000000010596d2bb _dispatch_once_callout + 66 17 libswiftCore.dylib 0x00000001051dad09 swift_once + 25 18 ZendeskSDK 0x0000000104a47964 $s10ZendeskSDK9ConstantsO7StringsO12cancelButtonSSvau + 36 19 ZendeskSDK 0x00000001049daadc $s10ZendeskSDK11DismissUtilC12barButtonFor_9embededIn6actionSo05UIBarF4ItemCSo16UIViewControllerC_So012UINavigationN0CSg10ObjectiveC8SelectorVtFZ + 1324 20 ZendeskSDK 0x0000000104aaec70 $s10ZendeskSDK26CoordinatingViewControllerC14viewWillAppearyySbF + 336 21 ZendeskSDK 0x0000000104aaecfc $s10ZendeskSDK26CoordinatingViewControllerC14viewWillAppearyySbFTo + 60 22 UIKitCore 0x00007fff46f0ebd5 -[UIViewController _setViewAppearState:isAnimating:] + 661 23 UIKitCore 0x00007fff46f0f2f1 -[UIViewController viewWillAppear:] + 115 24 UIKitCore 0x00007fff46e6d7d5 -[UINavigationController _startTransition:fromViewController:toViewController:] + 689 25 UIKitCore 0x00007fff46e6e47a -[UINavigationController _startDeferredTransitionIfNeeded:] + 868 26 UIKitCore 0x00007fff46e6f7e5 -[UINavigationController viewWillLayoutSubviews] + 150 27 UIKitCore 0x00007fff46e51127 -[UILayoutContainerView layoutSubviews] + 217 28 UIKitCore 0x00007fff47a52ad5 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2478 29 QuartzCore 0x00007fff2b06e91d -[CALayer layoutSublayers] + 255 30 QuartzCore 0x00007fff2b073323 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 517 31 QuartzCore 0x00007fff2b07fa7c _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 80 32 QuartzCore 0x00007fff2afc6e54 _ZN2CA7Context18commit_transactionEPNS_11TransactionEd + 324 33 QuartzCore 0x00007fff2affc32f _ZN2CA11Transaction6commitEv + 643 34 UIKitCore 0x00007fff475a23bf _afterCACommitHandler + 160 35 CoreFoundation 0x00007fff23b0c667 CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION + 23 36 CoreFoundation 0x00007fff23b070fe CFRunLoopDoObservers + 430 37 CoreFoundation 0x00007fff23b0777a __CFRunLoopRun + 1514 38 CoreFoundation 0x00007fff23b06e66 CFRunLoopRunSpecific + 438 39 GraphicsServices 0x00007fff38346bb0 GSEventRunModal + 65 40 UIKitCore 0x00007fff47578dd0 UIApplicationMain + 1621 41 Pura 0x000000010288d320 main + 112 42 libdyld.dylib 0x00007fff516ecd29 start + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException (lldb) ```

Versions

github-actions[bot] commented 4 years ago

Hi, Thank you for your contribution 🤗, We will look into this shortly.' first issue

octavezero commented 4 years ago

Hi, can you confirm a few details?

  1. The version of the rn-zendesk library?
  2. The IPHONEOS_DEPLOYMENT_TARGET and SWIFT_VERSION values from the project.pbxproj file?
  3. Also, if possible can you reproduce this on Android or is it happening only on iOS?

This seems to be an issue related to swift configuration in xcode.

leomercier commented 4 years ago

Thanks for the reply.

  1. rn-zendesk -^1.0.4
  2. IPHONEOS_DEPLOYMENT_TARGET = 11.0; SWIFT_VERSION = 5.0;
  3. I have not tried yet on Android. Will test.
leomercier commented 4 years ago

I have done a lot more debugging.

When creating a fresh react native project using react-native init newproject --version react-native@0.61.4 there is no issue.

The issue seems to be when starting a RN project in Expo and then ejecting.

I have setup a demo to show here - https://github.com/crowdform/rn-zendesk-starter

Files to check would be.

octavezero commented 4 years ago

Thanks for the new info.

Ideally the library should work on an ejected project, but it has not been tested in this scenario. I'll take a look into it.