flurry / flurry-ios-sdk

Flurry iOS SDK CocoaPods
Apache License 2.0
155 stars 65 forks source link

FlurryMessaging.setAutoIntegrationForMessaging() is crashed. #225

Open perlasivakrishna opened 3 years ago

perlasivakrishna commented 3 years ago

Describe the bug FlurryMessaging.setAutoIntegrationForMessaging() is crashing, if i comment this line not getting that crash, Please help me. Downgraded to 9.3.1 where no crash is happening.

-[NSError length]: unrecognized selector sent to instance 0x60000229a670 2021-02-25 16:02:43.512231+0530 Papertrell[92189:1395211] Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSError length]: unrecognized selector sent to instance 0x60000229a670' First throw call stack: ( 0 CoreFoundation 0x00007fff2041daf2 exceptionPreprocess + 242 1 libobjc.A.dylib 0x00007fff20177e78 objc_exception_throw + 48 2 CoreFoundation 0x00007fff2042c6f7 +[NSObject(NSObject) instanceMethodSignatureForSelector:] + 0 3 CoreFoundation 0x00007fff20422032 __forwarding + 1489 4 CoreFoundation 0x00007fff20424068 _CF_forwarding_prep_0 + 120 5 libswiftFoundation.dylib 0x00000001073f9e03 $s10Foundation4DataV36_unconditionallyBridgeFromObjectiveCyACSo6NSDataCSgFZTf4nd_n + 51 6 Papertrell 0x0000000103adaed5 $s10Papertrell11AppDelegateC11application_48didRegisterForRemoteNotificationsWithDeviceTokenySo13UIApplicationC_10Foundation4DataVtFTo + 85 7 GoogleUtilities 0x000000010580dd7e -[GULAppDelegateSwizzler application:donor_didRegisterForRemoteNotificationsWithDeviceToken:] + 265 8 Flurry_iOS_SDK 0x0000000105634f6a swizzled_applicationdidFailToRegisterForRemoteNotificationsWithError + 149 9 libdispatch.dylib 0x00000001078457ec _dispatch_call_block_and_release + 12 10 libdispatch.dylib 0x00000001078469c8 _dispatch_client_callout + 8 11 libdispatch.dylib 0x0000000107854e75 _dispatch_main_queue_callback_4CF + 1152 12 CoreFoundation 0x00007fff2038bdab CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 9 13 CoreFoundation 0x00007fff2038662e __CFRunLoopRun + 2685 14 CoreFoundation 0x00007fff203856c6 CFRunLoopRunSpecific + 567 15 GraphicsServices 0x00007fff2b76adb3 GSEventRunModal + 139 16 UIKitCore 0x00007fff24675187 -[UIApplication _run] + 912 17 UIKitCore 0x00007fff2467a038 UIApplicationMain + 101 18 Papertrell 0x000000010310bbcb main + 75 19 libdyld.dylib 0x00007fff20256409 start + 1 20 ??? 0x0000000000000001 0x0 + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSError length]: unrecognized selector sent to instance 0x60000229a670' terminating with uncaught exception of type NSException CoreSimulator 732.18.0.2 - Device: iPhone 12 Pro (9CE81735-3865-4323-922D-8294928AB1DB) - Runtime: iOS 14.2 (18B79) - DeviceType: iPhone 12 Pro

This Bug is About Please choose the closest item by replacing [ ] with [x].

Platform Please choose the platform(s) that you are having the issue by replacing [ ] with [x].

Environment Please tell us the versions of Flurry SDK, XCode, and iOS you are using.

Are you using Flurry Push/Messaging? Yes (iOS) Are you using CocoaPods or manual binary integration? CocoaPods

hantao-flurrydev commented 3 years ago

@perlasivakrishna Thanks for sharing this issue with us. So on which iOS SDK version that you saw this crash? I also saw you have included other third-party dependency from your crash report, so could you partition them to see if the crash is still there?

perlasivakrishna commented 3 years ago

iOS 14.2 I have created a sample project here with the issue. please check it. Thanks.

hantao-flurrydev commented 3 years ago

Hi @perlasivakrishna, thanks for sharing the project. We found the reason for this crash in our FlurryMessaging SDK callback swizzler (NSError was accidentally parsed to @selector(application:didRegisterForRemoteNotificationsWithDeviceToken:) rather than @selector(application:didFailToRegisterForRemoteNotificationsWithError:)). However this wasn't causing any issue in ObjC, and the crash was only reproducible using swift. The fix we put will be released in next GA release in late March. Meanwhile you can either skip the original implementation in AppDelegate.swift for application:didFailToRegisterForRemoteNotificationsWithError: or using ObjC implementation. Let me know if you have any questions.

hantao-flurrydev commented 3 years ago

@perlasivakrishna Please upgrade to v11.2.1 to integrate the fix of this crash