App Crash when Accessing App From Notification Bar (iOS 8)

Hi guys,

When my app receives a notification, it appears in the notification bar. But when I tap on it, the app tries to launch but crashes instead. The app works fine when loaded normally. Tested it on a iOS7 device, and shows the similar behaviour.

Anyone knows what’s the problem of the app crashing when trying to load it from the notification bar ?

I am using Corona 2014.2453 (latest) on a Mac

Here’s a snippet of the crash log i got from Xcode (from actual iPad device).

Oct &nbsp;5 19:09:18 LKs-iPad Best[193] \<Error\>: assertion failed: 12A405: libxpc.dylib + 51955 [84E1BEE3-B897-39DD-9A7B-D061B6B252C5]: 0x7dOct &nbsp;5 19:09:18 LKs-iPad Unknown[193] \<Error\>:&nbsp; Oct &nbsp;5 19:09:18 LKs-iPad Best[193] \<Error\>: -[NSNull count]: unrecognized selector sent to instance 0x37b063d0 Oct &nbsp;5 19:09:18 LKs-iPad Best[193] \<Error\>: \*\*\* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSNull count]: unrecognized selector sent to instance 0x37b063d0' \*\*\* First throw call stack: (0x2976ef87 0x3719dc77 0x2977437d 0x29772259 0x296a3d68 0x7841b 0x97bf3 0x7d20d 0x7d3f3 0x7dbcb 0x2cc57f81 0x2ce4ce85 0x2ce4f3b9 0x2ce59c69 0x2ce4dc5b 0x2fe680e1 0x2973582d 0x29734af1 0x2973364b 0x29680db1 0x29680bc3 0x2cc51c37 0x2cc4ca31 0x714e3 0x37739aaf) Oct &nbsp;5 19:09:18 LKs-iPad ReportCrash[192] \<Notice\>: ReportCrash acting against PID 193 Oct &nbsp;5 19:09:18 LKs-iPad diagnosticd[171] \<Error\>: error evaluating process info - pid: 193, punique: 193 Oct &nbsp;5 19:09:18 LKs-iPad ReportCrash[192] \<Notice\>: Formulating crash report for process Best[193] Oct &nbsp;5 19:09:18 LKs-iPad SpringBoard[41] \<Warning\>: BSXPCMessage received error for message: Connection invalid Oct &nbsp;5 19:09:18 LKs-iPad com.apple.xpc.launchd[1] (UIKitApplication:com.MYAPP[0xb3be][193]) \<Notice\>: Service exited due to signal: Abort trap: 6 Oct &nbsp;5 19:09:19 LKs-iPad ReportCrash[192] \<Notice\>: Saved report to /var/mobile/Library/Logs/CrashReporter/Best\_2014-10-05-190918\_LKs-iPad.ips Oct &nbsp;5 19:09:19 LKs-iPad SpringBoard[41] \<Warning\>: Application 'UIKitApplication:com.MYAPP[0xb3be]' crashed. Oct &nbsp;5 19:09:19 LKs-iPad locationd[61] \<Notice\>: Gesture EnabledForTopCLient: 0, EnabledInDaemonSettings: 0 Oct &nbsp;5 19:09:33 LKs-iPad locationd[61] \<Notice\>: Gesture EnabledForTopCLient: 0, EnabledInDaemonSettings: 0 Oct &nbsp;5 19:09:42 LKs-iPad syncdefaultsd[184] \<Notice\>: (Note ) marked "com.me.keyvalueservice" topic as "opportunistic" on \<APSConnection: 0x14e67260\> Oct &nbsp;5 19:09:43 LKs-iPad locationd[61] \<Notice\>: Gesture EnabledForTopCLient: 0, EnabledInDaemonSettings: 0 Oct &nbsp;5 19:09:45 LKs-iPad kernel[0] \<Notice\>: AppleARMPMUCharger: AppleUSBCableDetect 1 Oct &nbsp;5 19:09:45 LKs-iPad kernel[0] \<Notice\>: AppleARMPMUCharger: AppleUSBCableType USBHost Oct &nbsp;5 19:09:46 LKs-iPad ptpd[195] \<Error\>: ptpd: startResponder

Is this a push notification or a local notification?

If it’s a push, are you setting any data in your custom table?

Thanks

Rob

I have this behavior too. I thought it was connected to GameThrive, are you using GameThrive by any chance? 

This is a push notification. No custom data sent. How would sending custom data interfere with it ?

I am not using GameThrive. I am using my own, as I need some custom stuff.

Sample data sent to APN before encryption is below. Note that I am using sandbox mode and sending it to “ssl://gateway.sandbox.push.apple.com:2195”

{"aps":{"alert":"New","badge":0,"sound":"default"},"custom":null}

Custom data if it was malformed could interfere with the decoding of the JSON.  But that doesn’t seem like its an issue.  Can you put some print’s in your Corona app and see if it’s crashing before your app starts or if  you’re getting into your code some where?

Keep in mind that if your app is not running at all, your code in your “LaunchArgs” will processed.  If your app is in memory, your notification event handler will fire.

Rob

I tried to put a print right at the start of main.lua, and i don’t see anything in the logs.

I suspect it has something to do with the notification, as when I tried with another notification, the app launches fine. I will try to drill it down in the next few days…

Log:

Oct &nbsp;8 19:31:47 Lee-s-iPad kernel[0] \<Debug\>: 235846.346308 wlan.A[49626] AppleBCMWLANProximityInterface::doSetSyncState(): Cancelled fAWDLOffTimerOct &nbsp;8 19:31:50 Lee-s-iPad kernel[0] \<Debug\>: launchd[1540] Container: /private/var/mobile/Applications/2F95E22D-6739-4FEF-80C8-9DA04B3781C2 (sandbox) Oct &nbsp;8 19:31:50 Lee-s-iPad backboardd[30] \<Error\>: HID: The 'Passive' connection '(null)' access to protected services is denied. Oct &nbsp;8 19:31:50 Lee-s-iPad Best[1540] \<Error\>: -[NSNull count]: unrecognized selector sent to instance 0x3a571a60 Oct &nbsp;8 19:31:50 Lee-s-iPad Best[1540] \<Error\>: \*\*\* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSNull count]: unrecognized selector sent to instance 0x3a571a60' \*\*\* First throw call stack: (0x2f2e7f0b 0x39daece7 0x2f2eb837 0x2f2ea137 0x2f239098 0x8b273 0xaaa03 0x9004b 0x90297 0x90a7f 0x31b86cc1 0x31b86613 0x31b80cc9 0x31b1cc97 0x31b1bdf9 0x31b80405 0x34146b55 0x3414673f 0x2f2b2847 0x2f2b27e3 0x2f2b0faf 0x2f21b769 0x2f21b54b 0x31b7f62b 0x31b7a891 0x84333 0x3a2acab7) Oct &nbsp;8 19:31:50 Lee-s-iPad ReportCrash[1541] \<Notice\>: ReportCrash acting against PID 1540 Oct &nbsp;8 19:31:51 Lee-s-iPad ReportCrash[1541] \<Notice\>: Formulating crash report for process Best[1540] Oct &nbsp;8 19:31:51 Lee-s-iPad com.apple.launchd[1] (UIKitApplication:com.MYAPP[0xe1d0][1540]) \<Warning\>: (UIKitApplication:com.MYAPP[0xe1d0]) Job appears to have crashed: Abort trap: 6 Oct &nbsp;8 19:31:51 Lee-s-iPad backboardd[30] \<Warning\>: Application 'UIKitApplication:com.MYAPP[0xe1d0]' exited abnormally with signal 6: Abort trap: 6 Oct &nbsp;8 19:31:51 Lee-s-iPad ReportCrash[1541] \<Notice\>: Saved crashreport to /var/mobile/Library/Logs/CrashReporter/Best\_2014-10-08-193150\_Lee-s-iPad.ips using uid: 0 gid: 0, synthetic\_euid: 501 egid: 0

At this point, I would suggest that you try to build a minimal sample that has this crash and file a bug report.  The engineers will need to have a way to duplicate the problem so you may need to include instructions on how to send the push so they can look at it.   Make sure to include the build.settings and config.lua as well as any assets needed to compile and run the app.

Rob

yosu, the error you’re getting might be because you’re setting the value of “custom” to null. You should just omit the “custom” key/value pair if you aren’t sending any custom data.

On a side note, I help work on GameThrive. Feel free to get in touch if you’re considering using our service but we’re missing a feature that you need. (We do already support custom data if that’s what you’re looking for).

jonjonsson, are you still having any crashing issues?

Thanks for asking. It is fine now.

Is this a push notification or a local notification?

If it’s a push, are you setting any data in your custom table?

Thanks

Rob

I have this behavior too. I thought it was connected to GameThrive, are you using GameThrive by any chance? 

This is a push notification. No custom data sent. How would sending custom data interfere with it ?

I am not using GameThrive. I am using my own, as I need some custom stuff.

Sample data sent to APN before encryption is below. Note that I am using sandbox mode and sending it to “ssl://gateway.sandbox.push.apple.com:2195”

{"aps":{"alert":"New","badge":0,"sound":"default"},"custom":null}

Custom data if it was malformed could interfere with the decoding of the JSON.  But that doesn’t seem like its an issue.  Can you put some print’s in your Corona app and see if it’s crashing before your app starts or if  you’re getting into your code some where?

Keep in mind that if your app is not running at all, your code in your “LaunchArgs” will processed.  If your app is in memory, your notification event handler will fire.

Rob

I tried to put a print right at the start of main.lua, and i don’t see anything in the logs.

I suspect it has something to do with the notification, as when I tried with another notification, the app launches fine. I will try to drill it down in the next few days…

Log:

Oct &nbsp;8 19:31:47 Lee-s-iPad kernel[0] \<Debug\>: 235846.346308 wlan.A[49626] AppleBCMWLANProximityInterface::doSetSyncState(): Cancelled fAWDLOffTimerOct &nbsp;8 19:31:50 Lee-s-iPad kernel[0] \<Debug\>: launchd[1540] Container: /private/var/mobile/Applications/2F95E22D-6739-4FEF-80C8-9DA04B3781C2 (sandbox) Oct &nbsp;8 19:31:50 Lee-s-iPad backboardd[30] \<Error\>: HID: The 'Passive' connection '(null)' access to protected services is denied. Oct &nbsp;8 19:31:50 Lee-s-iPad Best[1540] \<Error\>: -[NSNull count]: unrecognized selector sent to instance 0x3a571a60 Oct &nbsp;8 19:31:50 Lee-s-iPad Best[1540] \<Error\>: \*\*\* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSNull count]: unrecognized selector sent to instance 0x3a571a60' \*\*\* First throw call stack: (0x2f2e7f0b 0x39daece7 0x2f2eb837 0x2f2ea137 0x2f239098 0x8b273 0xaaa03 0x9004b 0x90297 0x90a7f 0x31b86cc1 0x31b86613 0x31b80cc9 0x31b1cc97 0x31b1bdf9 0x31b80405 0x34146b55 0x3414673f 0x2f2b2847 0x2f2b27e3 0x2f2b0faf 0x2f21b769 0x2f21b54b 0x31b7f62b 0x31b7a891 0x84333 0x3a2acab7) Oct &nbsp;8 19:31:50 Lee-s-iPad ReportCrash[1541] \<Notice\>: ReportCrash acting against PID 1540 Oct &nbsp;8 19:31:51 Lee-s-iPad ReportCrash[1541] \<Notice\>: Formulating crash report for process Best[1540] Oct &nbsp;8 19:31:51 Lee-s-iPad com.apple.launchd[1] (UIKitApplication:com.MYAPP[0xe1d0][1540]) \<Warning\>: (UIKitApplication:com.MYAPP[0xe1d0]) Job appears to have crashed: Abort trap: 6 Oct &nbsp;8 19:31:51 Lee-s-iPad backboardd[30] \<Warning\>: Application 'UIKitApplication:com.MYAPP[0xe1d0]' exited abnormally with signal 6: Abort trap: 6 Oct &nbsp;8 19:31:51 Lee-s-iPad ReportCrash[1541] \<Notice\>: Saved crashreport to /var/mobile/Library/Logs/CrashReporter/Best\_2014-10-08-193150\_Lee-s-iPad.ips using uid: 0 gid: 0, synthetic\_euid: 501 egid: 0

At this point, I would suggest that you try to build a minimal sample that has this crash and file a bug report.  The engineers will need to have a way to duplicate the problem so you may need to include instructions on how to send the push so they can look at it.   Make sure to include the build.settings and config.lua as well as any assets needed to compile and run the app.

Rob

yosu, the error you’re getting might be because you’re setting the value of “custom” to null. You should just omit the “custom” key/value pair if you aren’t sending any custom data.

On a side note, I help work on GameThrive. Feel free to get in touch if you’re considering using our service but we’re missing a feature that you need. (We do already support custom data if that’s what you’re looking for).

jonjonsson, are you still having any crashing issues?

Thanks for asking. It is fine now.