-
Notifications
You must be signed in to change notification settings - Fork 127
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
RuntimeException
on stop
#40
Comments
To make matters worse, you cannot stop the recording after is error was thrown. Also, If you try to call D/AudioRecorder(13610): Stop
E/MediaRecorder(13610): stop called in an invalid state: 0
E/MethodChannel#audio_recorder(13610): Failed to handle method call
E/MethodChannel#audio_recorder(13610): java.lang.IllegalStateException
E/MethodChannel#audio_recorder(13610): at android.media.MediaRecorder.stop(Native Method)
E/MethodChannel#audio_recorder(13610): at com.jordanalcaraz.audiorecorder.audiorecorder.AudioRecorderPlugin.stopNormalRecording(AudioRecorderPlugin.java:134)
E/MethodChannel#audio_recorder(13610): at com.jordanalcaraz.audiorecorder.audiorecorder.AudioRecorderPlugin.stopRecording(AudioRecorderPlugin.java:128)
E/MethodChannel#audio_recorder(13610): at com.jordanalcaraz.audiorecorder.audiorecorder.AudioRecorderPlugin.onMethodCall(AudioRecorderPlugin.java:66)
E/MethodChannel#audio_recorder(13610): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:222)
E/MethodChannel#audio_recorder(13610): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:96)
E/MethodChannel#audio_recorder(13610): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:643)
E/MethodChannel#audio_recorder(13610): at android.os.MessageQueue.nativePollOnce(Native Method)
E/MethodChannel#audio_recorder(13610): at android.os.MessageQueue.next(MessageQueue.java:325)
E/MethodChannel#audio_recorder(13610): at android.os.Looper.loop(Looper.java:142)
E/MethodChannel#audio_recorder(13610): at android.app.ActivityThread.main(ActivityThread.java:6494)
E/MethodChannel#audio_recorder(13610): at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#audio_recorder(13610): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
E/MethodChannel#audio_recorder(13610): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
E/flutter (13610): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: PlatformException(error, null, null)
E/flutter (13610): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:564:7)
E/flutter (13610): #1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:316:33)
E/flutter (13610): <asynchronous suspension>
E/flutter (13610): #2 AudioRecorder.stop (package:audio_recorder/audio_recorder.dart:49:33)
E/flutter (13610): <asynchronous suspension>
E/flutter (13610): #3 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:635:14)
E/flutter (13610): #4 _InkResponseState.build.<anonymous closure> (package:flutter/src/material/ink_well.dart:711:32)
E/flutter (13610): #5 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:182:24)
E/flutter (13610): #6 TapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:365:11)
E/flutter (13610): #7 TapGestureRecognizer.handlePrimaryPointer (package:flutter/src/gestures/tap.dart:275:7)
E/flutter (13610): #8 PrimaryPointerGestureRecognizer.handleEvent (package:flutter/src/gestures/recognizer.dart:455:9)
E/flutter (13610): #9 PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:75:13)
E/flutter (13610): #10 PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:102:11)
E/flutter (13610): #11 _WidgetsFlutterBinding&BindingBase&GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:218:19)
E/flutter (13610): #12 _WidgetsFlutterBinding&BindingBase&GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:198:22)
E/flutter (13610): #13 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:156:7)
E/flutter (13610): #14 _WidgetsFlutterBinding&BindingBase&GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:102:7)
E/flutter (13610): #15 _WidgetsFlutterBinding&BindingBase&GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:86:7)
E/flutter (13610): #16 _rootRunUnary (dart:async/zone.dart:1136:13)
E/flutter (13610): #17 _CustomZone.runUnary (dart:async/zone.dart:1029:19)
E/flutter (13610): #18 _CustomZone.runUnaryGuarded (dart:async/zone.dart:931:7)
E/flutter (13610): #19 _invoke1 (dart:ui/hooks.dart:250:10)
E/flutter (13610): #20 _dispatchPointerDataPacket (dart:ui/hooks.dart:159:5) |
it seems it is a bug. here facing with the same issue! |
may cause by stop() is called immediately after start()... i tried `` try { }` `` |
If you quickly start and stop a recording, a
RuntimeException
is thrown from Java, resulting in aPlatformException
in Flutter:You should be able to reproduce this issue with the following snippet:
Pubspec dependencies:
@ZaraclaJ
The text was updated successfully, but these errors were encountered: