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.

Crashing in iOS after returning from background

See original GitHub issue

I’m getting a crash when my app returns from background. I’m able to record and stop recording all day long when the app first comes up… but hitting record after coming back from background the app crashes.

It throws EXC_BAD_ACCESS(code=1, adress=0xWtver123) at line 89 in cordova-plugin-audioinput/src/ios/CDVAudioInputCapture.m

Here: https://github.com/edimuj/cordova-plugin-audioinput/blob/master/src/ios/CDVAudioInputCapture.m#L89

I don’t ObjC from a hole in the ground so any help would be much appreciated. Love the plugin it does exactly what I needed. I was also a little confused as to how to connect it up to my WebAudio lib. I’m using Recorder.js (https://github.com/mattdiamond/Recorderjs) but this is how I got it to work… perhaps there is a better way of connecting the 2 and I’m not sure if it’s related?

Any advice would be much appreciated.

This is what my code essentially looks like minus some DOM stuff.

startRecording: function(){
        // Start audioinput streaming to WebAudio        
        audioinput.start({ streamToWebAudio: true});

        if(this.recorder){
            this.recorder.clear();
            this.recorder.record();
        } else {
            // Here I use audioinput._micGainNode as the source for a new recorder.js instance
            this.recorder = new Recorder(audioinput._micGainNode, {numChannels:1});
            this.recorder.record();
        }
},

stopRecording: function(){
        this.recorder.stop();
        // I stop audioinput after I stop recording
        audioinput.stop();
        this.recorder.exportWAV(this.setRecordedFile);
}

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
KrisHedgescommented, Sep 3, 2016

Thank you so much for this plugin and your extremely well thought responses to my issues. I managed to minimize the crashes by reinitialuzing the plugin after returning from background. It still happens on occasion but is mostly under control in normal usage. I also managed to get my app in the stores. I think by limiting the sound recording to a short time period (20s with a timer) it was allowed to slide… Thank goodness. Anyway thank you for all your help.

0reactions
edimujcommented, Aug 18, 2017

Doing some housekeeping: Since there hasn’t been any action regarding this issue for a time now, I’m closing it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Crash in background on iOS 15 EXC_CRASH (SIGKILL)
We have deployed a fix to the backend services that provide crashes for your app into the Xcode Organizer, so if you receive...
Read more >
ios - How to debug a crash which happened when come back ...
Start app through click on app icon. · Use the app as normal user. · Press home to put it in background. ·...
Read more >
Crash when come back from background (iOS) - Wikitude
1 to develop the wikitude phonegap application. Im encountering hang/crash with my iOS app when i load the app from background while still...
Read more >
How to Fix Crashing Apps on an iPhone or Android?
10 Solutions to fix App Crashes and Keep Apps Running: For Apple iPhone, Samsung Galaxy, LG, Lenovo and Sony Xperia smartphones · Why...
Read more >
Fix Apple iPhone with apps that keep crashing after iOS 13
Random and frequent app crashes in mobile devices usually denote a memory issue like when the device is running low on storage.
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