question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Crashes on iOS 11 GM (unrecognized selector sent to [__NSCFBumber un_logDigest]) -- with 'fix'

See original GitHub issue

WARNING: IF YOU IGNORE THIS TEMPLATE, WE’LL IGNORE YOUR ISSUE. YOU MUST FILL THIS IN!

Provide a general summary of the issue.

Existing apps that work on iOS10 crash on iOS11.

Your Environment

  • Plugin version: (customized fork to add LED control and incorporate early iOS10 fixes) de.appplant.cordova.plugin.local-notification 0.8.4+ledControl+spk0611iOS10Changes
  • Platform: iOS
  • OS version: iOS 11GM (11.0 15A372)
  • Device manufacturer / model: iPhone 6 simulator (Xcode9) iPhone 6S+, iPod Touch 6th Gen
  • Cordova version (cordova -v): 7.0.1
  • Cordova platform version (cordova platform ls):
Installed platforms:
  android 6.1.2
  ios 4.1.1
Available platforms: 
  blackberry10 ~3.8.0 (deprecated)
  browser ~4.1.0
  osx ~4.0.1
  webos ~3.7.0
  • Plugin config
(!744)-> cordova plugins ls
cordova-custom-config 3.1.2 "cordova-custom-config"
cordova-plugin-app-event 1.2.0 "Application Events"
cordova-plugin-background-task 0.2.0 "Background Task"
cordova-plugin-camera 2.3.2-dev "Camera"
cordova-plugin-compat 1.1.0 "Compat"
cordova-plugin-console 1.0.5 "Console"
cordova-plugin-device 1.1.4 "Device"
cordova-plugin-dialogs 1.2.1 "Notification"
cordova-plugin-email-composer 0.8.3 "EmailComposer"
cordova-plugin-file 4.2.0 "File"
cordova-plugin-fullscreen 1.1.0 "cordova-plugin-fullscreen"
cordova-plugin-globalization 1.0.5 "Globalization"
cordova-plugin-inappbrowser 1.4.0 "InAppBrowser"
cordova-plugin-insomnia 4.2.0 "Insomnia (prevent screen sleep)"
cordova-plugin-media 1.0.1 "Media"
cordova-plugin-navigationbar 1.0.31 "Cordova NavigationBar plugin"
cordova-plugin-network-information 1.2.1 "Network Information"
cordova-plugin-splashscreen 3.2.2 "Splashscreen"
cordova-plugin-statusbar 2.1.3 "StatusBar"
cordova-plugin-whitelist 1.3.2-dev "Whitelist"
de.appplant.cordova.plugin.local-notification 0.8.4+ledControl+spk0611iOS10Changes "LocalNotification"
phonegap-plugin-mobile-accessibility 1.0.5-dev "Mobile Accessibility"
phonegap-plugin-push 1.8.4 "PushPlugin"
  • Ionic Version (if using Ionic)

Expected Behavior

things work as they have for some time

Actual Behavior

Crashes:

2017-09-14 12:44:44.238895-0700 xxx[26031:966628] -[__NSCFNumber un_logDigest]: unrecognized selector sent to instance 0xb00015e81ec0c553
2017-09-14 12:44:44.242338-0700 xxx[26031:966628] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFNumber un_logDigest]: unrecognized selector sent to instance 0xb00015e81ec0c553'
*** First throw call stack:
(
	0   CoreFoundation                      0x00000001033941cb __exceptionPreprocess + 171
	1   libobjc.A.dylib                     0x0000000102cc8f41 objc_exception_throw + 48
	2   CoreFoundation                      0x0000000103414914 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
	3   CoreFoundation                      0x0000000103317178 ___forwarding___ + 1432
	4   CoreFoundation                      0x0000000103316b58 _CF_forwarding_prep_0 + 120
	5   UserNotifications                   0x0000000104361b9c -[UNUserNotificationServiceConnection addNotificationRequest:forBundleIdentifier:withCompletionHandler:] + 280
	6   UserNotifications                   0x000000010435e2de -[UNUserNotificationCenter addNotificationRequest:withCompletionHandler:] + 113
	7   2Morrow                             0x00000001009c9fb4 -[APPLocalNotification fireEvent:notification:] + 1572
	8   2Morrow                             0x00000001009c5740 __33-[APPLocalNotification schedule:]_block_invoke + 640
	9   libdispatch.dylib                   0x00000001052373f7 _dispatch_call_block_and_release + 12
	10  libdispatch.dylib                   0x000000010523843c _dispatch_client_callout + 8
	11  libdispatch.dylib                   0x000000010523d352 _dispatch_queue_override_invoke + 1458
	12  libdispatch.dylib                   0x00000001052441f9 _dispatch_root_queue_drain + 772
	13  libdispatch.dylib                   0x0000000105243e97 _dispatch_worker_thread3 + 132
	14  libsystem_pthread.dylib             0x00000001056fb5a2 _pthread_wqthread + 1299
	15  libsystem_pthread.dylib             0x00000001056fb07d start_wqthread + 13
)
libc++abi.dylib: terminating with uncaught exception of type NSException

Steps to Reproduce

  1. upgrade to iOS11GM
  2. launch app

Context

our scheduling code. Scheduling done in the callback from cancelAll. Notifications in the gaMultiRemindersForKatzerLNPlugin array (yes, thank goodness for autocomplete)

cordova.plugins.notification.local.cancelAll(function scheduleAllRemindersViaKatzer() {
    cordova.plugins.notification.local.schedule(gaMultiRemindersForKatzerLNPlugin);
});

Debug logs

see above

  • ios XCode logs
  • Android: $ adb logcat

=============================== NOTE: I can make it not crash and schedule notifications, but it doesn’t make sense why from an outsider’s view.

To stop the crash, edit APPLocalNotification.m and comment out the following lines (you’re removing the adding of the notification request, there will now be some unused variable warnings):

/// 3. schedule localNotification
        UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
        [center addNotificationRequest:request withCompletionHandler:^(NSError * _Nullable error) {
            if (!error) {
                NSLog(@"add NotificationRequest succeeded!");
            }
        }];

I would think that this would prevent the notification from being scheduled at all. not the case. The notification is scheduled and fires on schedule. Go figure.

The implication is that the notification request is getting added somewhere else?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
yjukakucommented, Sep 21, 2017

I ran into this same issue, but I (thought I) narrowed it down using the debugger to line 724 in AppLocalNotification.m

        if(notification.userInfo!=nil && [notification.userInfo objectForKey:@"id"]!=nil) {
            identifier = [NSString stringWithFormat:@"%d", [notification.userInfo objectForKey:@"id"]];
        }

If anyone has a fix for this issue, please do chime in.

0reactions
katzercommented, Nov 1, 2017

Please reopen if its still an issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

unrecognized selector sent to ins… | Apple Developer Forums
Best would be to remove the connection anbd recreate. If not enough, please show the code where crash occurs ? If OK, don't...
Read more >
NSCFNumber isEqualToString: crash IOS11 between ...
[__NSCFNumber isEqualToString:]: unrecognized selector sent to ... It doesn't knows it (it is a NSString method), and then it crashes.
Read more >
Common Xcode Errors - Unrecognized Selector Error - YouTube
Have you ever gotten this " unrecognized selector " error when your app crashes in Xcode? Unrecognized selector means that Xcode couldn't find ......
Read more >
iOS NewRelicAgent 7.3.0 crash: unrecognized selector ...
This appears to be some kind of incompatibility with RxSwift. When I pass .NRFeatureFlag_InteractionTracing to disableFeatures() this crash goes ...
Read more >
Fixing "Unrecognized Selector Sent To Instance" Error In Xcode
The Selector might be a new thing for many iOS developers, so first let's find out what it means. Selectors in Objective-C. Even...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found