Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AVPlayer causes Simulator to crash but runs fine on device

I've searched all the Internet around, but found no mentions of this error.

I am using AVPlayer to play stream audio from remote or local URL. However, while on my device it works fine, on simulator it is crashing.

I've found out that creation of player is going fine, but as soon as I call [playerInstance play] the app crashes.

The error is occurring somewhere in CommonURLAssetNotificationQueue. And the exception breakpoint points me to 0x10e8a2519: pushq %rbp, which is not helpful at all.

However, on device it works fine.

So, is it my mistake and I have to fix the code? Or it's just simulator acting wonky?

like image 494
Alexander Woodblock Avatar asked Sep 12 '14 06:09

Alexander Woodblock


2 Answers

It is likely that you have an exception breakpoint enabled. The play method in AVPlayer normally throws an exception, even though nothing is wrong. The exception doesn't crash the app, and the app then continues to run exactly as you wanted it to. If you have exception breakpoints enabled, however, Xcode notices the exception and crashes the app. If you go into the left sidebar and disable your exception breakpoint the app will run without crashing.

like image 122
Bagelman Avatar answered Nov 02 '22 22:11

Bagelman


enter image description here

Change exception all as Objective C.

like image 4
erdikanik Avatar answered Nov 02 '22 23:11

erdikanik