Problem
Notification from other app crashes app playing video
Test case
* Create a mobile project using the attached app.js file
* Place a movie file that includes sound at Resources/movie.mov and run the app on the iPhone
* Arrange for a notification from another app while the movie is playing. You can use the built-in Reminders app
* Open the app that sent the notification via the notification's alert dialog, then return to the sample app
* At this point the sample app will crash. See also stack trace below.
NOTE: The notification has to come in the form of an alert dialog; banners don't trigger this problem.
var win = Ti.UI.createWindow({
backgroundColor: 'white',
orientationModes: [ Ti.UI.PORTRAIT ]
});
var videoPlayerView = Ti.Media.createVideoPlayer({
media: 'movie.mov',
movieControlMode: Ti.Media.VIDEO_CONTROL_EMBEDDED,
mediaControlStyle: Ti.Media.VIDEO_CONTROL_EMBEDDED,
scalingMode: Ti.Media.VIDEO_SCALING_ASPECT_FIT,
autoplay: false,
top:60
});
win.add(videoPlayerView);
win.open();
Logs
Dec 22 15:51:11 unknown UIKitApplication:com.logicallabs.babyfacestest[0xff95][6512] <Notice>: [ERROR] The application has crashed with an unhandled exception. Stack trace:
Dec 22 15:51:11 unknown UIKitApplication:com.logicallabs.babyfacestest[0xff95][6512] <Notice>: 0 CoreFoundation 0x340fa8bf __exceptionPreprocess + 162
Dec 22 15:51:11 unknown UIKitApplication:com.logicallabs.babyfacestest[0xff95][6512] <Notice>: 1 libobjc.A.dylib 0x3434a1e5 objc_exception_throw + 32
Dec 22 15:51:11 unknown UIKitApplication:com.logicallabs.babyfacestest[0xff95][6512] <Notice>: 2 AVFoundation 0x36d81cb5 -[AVPlayerItem _attachToPlayer:forImmediateEnqueueing:shouldAppendItem:] + 340
Dec 22 15:51:11 unknown UIKitApplication:com.logicallabs.babyfacestest[0xff95][6512] <Notice>: 3 AVFoundation 0x36d721f7 -[AVPlayer _insertPlaybackItemOfItem:inPlayerQueueAfterPlaybackItemOfItem:] + 42
Dec 22 15:51:11 unknown UIKitApplication:com.logicallabs.babyfacestest[0xff95][6512] <Notice>: 4 AVFoundation 0x36d79bf3 __-[AVPlayer _attachItem:andPerformOperation:withObject:]_block_invoke_2 + 1098
Dec 22 15:51:11 unknown UIKitApplication:com.logicallabs.babyfacestest[0xff95][6512] <Notice>: 5 libdispatch.dylib 0x36d23d55 _dispatch_call_block_and_release + 12
Dec 22 15:51:11 unknown UIKitApplication:com.logicallabs.babyfacestest[0xff95][6512] <Notice>: 6 libdispatch.dylib 0x36d2ee8d _dispatch_main_queue_callback_4CF$VARIANT$up + 196
Dec 22 15:51:11 unknown UIKitApplication:com.logicallabs.babyfacestest[0xff95][6512] <Notice>: 7 CoreFoundation 0x340cd2dd __CFRunLoopRun + 1268
Dec 22 15:51:11 unknown UIKitApplication:com.logicallabs.babyfacestest[0xff95][6512] <Notice>: 8 CoreFoundation 0x340504dd CFRunLoopRunSpecific + 300
Dec 22 15:51:11 unknown UIKitApplication:com.logicallabs.babyfacestest[0xff95][6512] <Notice>: 9 CoreFoundation 0x340503a5 CFRunLoopRunInMode + 104
Dec 22 15:51:11 unknown UIKitApplication:com.logicallabs.babyfacestest[0xff95][6512] <Notice>: 10 GraphicsServices 0x308d4fcd GSEventRunModal + 156
Dec 22 15:51:11 unknown UIKitApplication:com.logicallabs.babyfacestest[0xff95][6512] <Notice>: 11 UIKit 0x374d1743 UIApplicationMain + 1090
Dec 22 15:51:11 unknown UIKitApplication:com.logicallabs.babyfacestest[0xff95][6512] <Notice>: 12 babyfaces tests 0x0000453b babyfaces tests + 13627
Dec 22 15:51:11 unknown UIKitApplication:com.logicallabs.babyfacestest[0xff95][6512] <Notice>: 13 babyfaces tests 0x00003dc0 babyfaces tests + 11712
Thank you for raising this issue, Zsombor. Please note the changes that were necessary in order for me to be able to escalate it, as described in [JIRA Ticket Checklist](https://wiki.appcelerator.org/display/guides/How+to+Submit+a+Bug+Report#HowtoSubmitaBugReport-JIRATicketChecklist). Would you test this problem with the official release from yesterday, just in case it's been solved? I will mark this resolved for now. Once you have let me know about the above, reopen it, and I will then move it to the main project.
It does crash with official release SDK 1.8.0.1.
I don't seem to have permission to change the status of the ticket.
Unable to reproduce iPod 4GT iOS 5.0.1 (which does not come with Reminders, I used another alarm app which sends scheduled notifications). Reassigning to Blain since he has access to a 4S device.
Assigning back to me; can dupe on an iPad 2. This appears to be a dual-core/A5-specific problem. Crash message indicates that it could actually be an Apple bug.
Could not find pull request, but manually pulled. Unfortunately, the same crasher still happens. Perhaps we should make a radar about it? Can we recreate it outside of titanium?
I was both able to recreate and possibly resolve outside Titanium; this is going to get looked at again. The sample app resolution may be different due to multithreading concerns, but this is definitely going to get a radar.
Bug filed with Apple; Radar # is 10631746. A workaround may be viable; investigating it.
Must HOLD this ticket as it is an Apple bug. The workaround that I discovered in an independent app may not be working for several reasons: * Overloaded notification center * Notification center delivery order * Multithreading Going to make an attempt to reduce the possibility of multithread issues (movie object managed off main thread) but that will be a last-ditch attempt.
After numerous attempts to get the known workaround to behave appropriately, still getting the crash. We filed the Radar # as above and hopefully this issue is significant enough for Apple to address it within a near timeframe.
closing as this is an apple bug that we cannot address