Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle java.lang.RuntimeException: An error occurred while uting doInBackground() Exception #24

Open
sahifedp opened this issue Nov 15, 2017 · 13 comments

Comments

@sahifedp
Copy link

Hi
My app use ACRA crash report
this Exception reported several times:
Please handle this exception. thanks.

java.lang.RuntimeException: An error occurred while uting doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:309) at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
at java.util.concurrent.FutureTask.setException(FutureTask.java:223) at java.util.concurrent.FutureTask.run(FutureTask.java:242)
at android.os.AsyncTask$Serialutor$1.run(AsyncTask.java:234) at java.util.concurrent.ThreadPoolutor.runWorker(ThreadPoolutor.java:1113)
at java.util.concurrent.ThreadPoolutor$Worker.run(ThreadPoolutor.java:588) at java.lang.Thread.run(Thread.java:818)nCaused by: java.util.NoSuchElementException
at java.util.AbstractList$SimpleListIterator.next(AbstractList.java:59) at java.util.AbstractCollection.toArrayList(AbstractCollection.java:349)
at java.util.AbstractCollection.toArray(AbstractCollection.java:339) at java.util.ArrayList.addAll(ArrayList.java:188)
at com.googlecode.mp4parser.authoring.tracks.AppendTrack.getSamples(AppendTrack.java:357) at com.googlecode.mp4parser.authoring.builder.DefaultMp4Builder.build(DefaultMp4Builder.java:92)
at com.github.lassana.recorder.Mp4ParserWrapper.append(Mp4ParserWrapper.java:105) at com.github.lassana.recorder.Mp4ParserWrapper.append(Mp4ParserWrapper.java:48)
at com.github.lassana.recorder.AudioRecorder.appendToFile(AudioRecorder.java:287) at com.github.lassana.recorder.AudioRecorder.access$900(AudioRecorder.java:18)
at com.github.lassana.recorder.AudioRecorder$PauseRecordTask.doInBackground(AudioRecorder.java:131) at com.github.lassana.recorder.AudioRecorder$PauseRecordTask.doInBackground(AudioRecorder.java:117)
at android.os.AsyncTask$2.call(AsyncTask.java:295) at java.util.concurrent.FutureTask.run(FutureTask.java:237)n ... 4 morenjava.util.NoSuchElementException
at java.util.AbstractList$SimpleListIterator.next(AbstractList.java:59) at java.util.AbstractCollection.toArrayList(AbstractCollection.java:349)
at java.util.AbstractCollection.toArray(AbstractCollection.java:339) at java.util.ArrayList.addAll(ArrayList.java:188)
at com.googlecode.mp4parser.authoring.tracks.AppendTrack.getSamples(AppendTrack.java:357) at com.googlecode.mp4parser.authoring.builder.DefaultMp4Builder.build(DefaultMp4Builder.java:92)
at com.github.lassana.recorder.Mp4ParserWrapper.append(Mp4ParserWrapper.java:105) at com.github.lassana.recorder.Mp4ParserWrapper.append(Mp4ParserWrapper.java:48)
at com.github.lassana.recorder.AudioRecorder.appendToFile(AudioRecorder.java:287) at com.github.lassana.recorder.AudioRecorder.access$900(AudioRecorder.java:18)
at com.github.lassana.recorder.AudioRecorder$PauseRecordTask.doInBackground(AudioRecorder.java:131) at com.github.lassana.recorder.AudioRecorder$PauseRecordTask.doInBackground(AudioRecorder.java:117)
at android.os.AsyncTask$2.call(AsyncTask.java:295) at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$Serialutor$1.run(AsyncTask.java:234) at java.util.concurrent.ThreadPoolutor.runWorker(ThreadPoolutor.java:1113)
at java.util.concurrent.ThreadPoolutor$Worker.run(ThreadPoolutor.java:588) at java.lang.Thread.run(Thread.java:818)

@abhnerAraujo
Copy link

I'm getting this error too.

@kkl260
Copy link

kkl260 commented Sep 20, 2018

Anyone have a fix for this yet?

@sachinvarma
Copy link

@lassana If you can able to provide a solution for this, it will be be very helpful, my whole app is made upon on this, now changing this will cost me a lot, app is crashing a lot only due to this. Mostly in Samsung devices.

Caused by java.lang.IllegalStateException
at android.media.MediaRecorder._start(MediaRecorder.java)
at android.media.MediaRecorder.start(MediaRecorder.java:1170)
at com.github.lassana.recorder.AudioRecorder$StartRecordTask.doInBackground(SourceFile:90)
at com.github.lassana.recorder.AudioRecorder$StartRecordTask.doInBackground(SourceFile:79)
at android.os.AsyncTask$2.call(AsyncTask.java:304)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:243)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:762)

@lassana
Copy link
Owner

lassana commented Oct 31, 2018

@sachinvarma I suppose you should use a different audio recording configuration to avoid this. It would be helpful if you provided steps to reproduce the crash.

@sachinvarma
Copy link

sachinvarma commented Oct 31, 2018 via email

@lassana
Copy link
Owner

lassana commented Oct 31, 2018

Unfortunately, I don't have any Samsung device. I'd suggest to try different output configurations.

@sachinvarma
Copy link

sachinvarma commented Oct 31, 2018 via email

@sachinvarma
Copy link

sachinvarma commented Oct 31, 2018 via email

@netunlimited
Copy link

netunlimited commented Nov 20, 2018

@sachinvarma thanks for sharing, but could you explain a bit more please?

Did you change this line:
MediaRecorder.AudioSource.DEFAULT
into this:
MediaRecorder.AudioSource.MIC
and was that enough for you?
I've tried it but the crash is still occurring for Samsung devices.

Would you perhaps mind to share your output configuration such as bitrate, output format and encoder?
This crash is happening a lot in my app too, I'd love to fix it.

@sachinvarma
Copy link

sachinvarma commented Nov 20, 2018 via email

@netunlimited
Copy link

No i did more, @netunlimited Could you please try this, implementation "com.github.sachinvarma:continuous-audiorecorder:v1.3.3.3" and let me know whether it works for you or not.

@sachinvarma Thank you so much, I will launch an update and see if the crash is fixed for my users. I will let you know.

@qadirsuh
Copy link

Me too getting this error. any fix?

@qadirsuh
Copy link

qadirsuh commented Oct 12, 2021

No i did more, @netunlimited Could you please try this,
implementation "com.github.sachinvarma:continuous-audiorecorder:v1.3.3.3" and let me know whether it works for you or not.

@sachinvarma can you please tell me is it working still?

I have tried using different config combinations with no luck.

val mediaConfig = MediaRecorderConfig(
        64 * 1024,
        2,
        MediaRecorder.AudioSource.MIC,
        ApiHelper.DEFAULT_AUDIO_ENCODER
    )

mAudioRecorder = AudioRecorderBuilder.with(mApplication)
                .fileName(getNextFileName())
                .config(mediaConfig)
                .loggable()
                .build()

its getting crashed every time. :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants