[ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: PlatformException(startRecorder, startRecorder, Failure to start recorder, null)
See original GitHub issueThis error happens to me even if I make toFile: ‘flutter_example.aac’ as in the package example … here is my log:
I/flutter (15733): ---> openRecorderCompleted: true
I/flutter (15733): <--- openRecorderCompleted: true
I/flutter (15733): <--- openAudioSession
I/flutter (15733): FS:<--- openAudioSession
I/flutter (15733): ********* record outputpath : /data/user/0/com.q8intouch.hareem/cache/c34s2.aac
I/flutter (15733): FS:---> startRecorder
I/flutter (15733): FS:---> _startRecorder.
I/flutter (15733): Calling instance.startRecorder
E/MediaRecorder(15733): start failed: -38
E/SoundMediaRecorder(15733): Exception:
E/SoundMediaRecorder(15733): java.lang.IllegalStateException
E/SoundMediaRecorder(15733): at android.media.MediaRecorder.start(Native Method)
E/SoundMediaRecorder(15733): at com.dooboolab.TauEngine.q.a(:182)
E/SoundMediaRecorder(15733): at com.dooboolab.TauEngine.m.r(:239)
E/SoundMediaRecorder(15733): at f.e.b.e.M(:259)
E/SoundMediaRecorder(15733): at f.e.b.f.onMethodCall(:118)
E/SoundMediaRecorder(15733): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(:233)
E/SoundMediaRecorder(15733): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(:85)
E/SoundMediaRecorder(15733): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(:818)
E/SoundMediaRecorder(15733): at android.os.MessageQueue.nativePollOnce(Native Method)
E/SoundMediaRecorder(15733): at android.os.MessageQueue.next(MessageQueue.java:325)
E/SoundMediaRecorder(15733): at android.os.Looper.loop(Looper.java:142)
E/SoundMediaRecorder(15733): at android.app.ActivityThread.main(ActivityThread.java:6494)
E/SoundMediaRecorder(15733): at java.lang.reflect.Method.invoke(Native Method)
E/SoundMediaRecorder(15733): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
E/SoundMediaRecorder(15733): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
E/MediaRecorder(15733): resume called in an invalid state: 0
E/MediaRecorder(15733): stop called in an invalid state: 0
D/SoundMediaRecorder(15733): Error Stop Recorder
E/FlautoRecorder(15733): Error starting recordernull
E/flutter (15733): [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: PlatformException(startRecorder, startRecorder, Failure to start recorder, null)
E/flutter (15733): #0 StandardMethodCodec.decodeEnvelope
package:flutter/…/services/message_codecs.dart:597
E/flutter (15733): #1 MethodChannel._invokeMethod
package:flutter/…/services/platform_channel.dart:158
E/flutter (15733): <asynchronous suspension>
E/flutter (15733): #2 FlutterSoundRecorder._startRecorder
package:flutter_sound/public/flutter_sound_recorder.dart:662
E/flutter (15733): <asynchronous suspension>
E/flutter (15733): #3 FlutterSoundRecorder.startRecorder.<anonymous closure>
package:flutter_sound/public/flutter_sound_recorder.dart:584
E/flutter (15733): <asynchronous suspension>
E/flutter (15733): #4 BasicLock.synchronized
package:synchronized/src/basic_lock.dart:33
E/flutter (15733): <asynchronous suspension>
E/flutter (15733): #5 FlutterSoundRecorder.startRecorder
package:flutter_sound/public/flutter_sound_recorder.dart:583
E/flutter (15733): <asynchronous suspension>
Issue Analytics
- State:
- Created 2 years ago
- Comments:8
Top Results From Across the Web
PlatformException(startRecorder, startRecorder, Failure to ...
11+1. Exception has occurred. _Exception (Exception: PlatformException(startRecorder, startRecorder, Failure to start recorder, null)). Severity.
Read more >flutter - Unable to successfully call startRecorder(uri
Receiver: null Tried calling: startRecorder(codec: Instance of ... by using touch audio.aac and tried to record, I still got the same error.
Read more >FlutterSoundRecorder class - recorder library - Dart API
Using a recorder is very simple : Create a new FlutterSoundRecorder. Open it with openAudioSession(). Start your recording with startRecorder().
Read more >Recording and playing audio in Flutter - wafrat
startRecorder (null); result.then(path) { print('startRecorder: ... Once you start recording, flutter_sound records the audio in a file.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
No, actually I’ve run it on my device and it gets past the startRecorder portion on my phone.
What device and android version are you using for development @AbdallahLabib ?
Can you provide the exact code you’re using to open the audio session and start the recorder? Also can you provide the output of
flutter pub deps | grep flutter_sound
?