AVPlayer causes Simulator to crash but runs fine on device - ios

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?

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.

Change exception all as Objective C.

My resolving method is to add 'usage description' in App's Info page. Because the AVPlayer Demo App is trying to use local photo library without asking permission, this causes the demo app to crash. After adding the 'Privacy — Photo Library Usage Description', I can run this demo app successfully.

Related

TestFairy not reporting crashes

It was working for a moment and it suddenly stopped working.
So, the integration is fine, I guess. The version is 1.7.9
Now, what I get is videos and logs for the entire sessions except when the app crashes the video ends and there is no flag of crash in dashboard..
Have anyone experienced this before?
Could it be that you are initializing another crash handler (eg, HockeyApp or Crashlytics) after calling [TestFairy begin]? Most crash handlers don't pass the call after catching the exception, so only the last handler to be initialized will actually get the callback. TestFairy writes a log, and it should also appear in the session overview itself (in the timeline widget.) Hope this helps!

Is there a way to stop an app from closing if it stalls on splash screen?

I've been testing an app for iOS in Xamarin Studio, however whenever I reach a breakpoint or an exception is thrown and I stay there for a few seconds without pushing the continue execution button, the debugging session will close as the app will close on my device. This is due to the process mentioned here, as it is occurring during the splash screen, and if the app pauses too long there, it will close the app because it failed to scene-create. I was wondering if it is possible to disable this when debugging with breakpoints, because I would like to look at the data flow through variables and such.
As matt guessed, it is a Xamarin issue. The response to my inquiry to Xamarin was this,
Xamarin does not currently use a native debugger, thus watchdog is not
disabled. They are looking into alternatives, but for now a potential
workaround is to not do anything until you've returned from the
FinishedLaunching method (i.e. start your launch code in a timer event
for instance), and debug that instead.
Update: the status on this bug is "fixed for the next major release." as of 12/29/15

Test flight app crashes with libAVFAudio.dylib: AVAE_RaiseException(NSString*, ...) + 60

I uploaded an archive on app store and am getting crash when I 'm trying to play an intro sound. I'm using AVAudioEngine to play the sound. When I compile and run code through Xcode everything works fine. When I upload on TestFlight and try to run my app as an internal tester my app crashes. The crash report is:
If I use AVAudioPlayer to play that sound it's ok. I can't understand what is the problem with AVAudioEngine. Any advices?
I faced the same exception only in the release build of my app and specific to iPhone7.
The exception seems to occur at a changing point of audio session category.
In my case, changing from
AVAudioSessionCategorySoloAmbient
to
AVAudioSessionCategoryPlayAndRecord, with: AVAudioSessionCategoryOptions.defaultToSpeaker
I found a workaround which works at least just for me.
The following article
https://forums.developer.apple.com/thread/65656
tells that this kind of exception occurs at initialization of multiple input audio unit.
In order to prevent initialization of multiple input audio unit,
I added the following codes before the change of audio session category
AudioOutputUnitStop((engine.inputNode?.audioUnit)!)
AudioUnitUninitialize((engine.inputNode?.audioUnit)!)
engine is the instance of AVAudioEngine.
I hope it will help you guys!

iOS Recover app on crash

This is my first time that I'm running app on my device. I was wondering what to do when app crashes. When it crashes, I can not open the app again, the app data is corrupted I think. Do I need to write some code for this scenario? When app crashes I want to be able to open my app again. I was using simulator till now and this is my first time on my device. I was searching but could not found how to recover my app
You can recover from almost anything if you handle exceptions AND signals
BUT you should't:
crashes shouldn't happen and if you get a unix signal you shouldn't try to recover because after a near-crash the app may be in a quite undefined state
localize & fix & prevent the crash
Localize the source of the crash, add checks to prevent the crash. You can also set a global exception handler to help you debugging the issue.
I had same problem; and found a library that handles hardware exceptions that xcode can not. the library name called SignalRecovery;
you will find an error using the library in sizeof function that should take a struct.

Admob is crashing but very rare

Usually my iOS app works fine. But sometimes it crashes.
I attached screenshot. I called functions to show admob interstitial.
It crashed.
I am not sure how to debug it and why it crashed that time.
That code works fine most of time but rarely crashes.
My app uses ARC.
It is iphone Open GL ES 2.0 game with Admob and iAd
How do I debug it?
What steps should be done?
I am not sure when I will see such crash next time.
Crashes happen but not often. So If I will remove some components like iAd and will test then I do not know when it will crash and how many tests to run to ensure that removed part was coursing a problem or not.
I do not wish to submit app that sometime crashes. It may course bad reviews.
UPDATE for crashes
#try/#catch is not helping.
delegate update is not helping either.
I got such crash again and have no idea what I can do or what is coursing it.
Wrap that call with try/catch.

Resources