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

(not able to reproduce on local device) Play Console error: Exception java.lang.IllegalStateException: Reply already submitted #245

Closed
Piotr12 opened this issue Nov 21, 2023 · 1 comment

Comments

@Piotr12
Copy link

Piotr12 commented Nov 21, 2023

Package Version

  • record_android: 1.0.3
  • record: 5.0.1

Environment

  • Android (various devices, various versions)

Describe the bug
I am getting significant amount of crash reports in google play console (dozen per day, have no more than couple of hundreds of sessions), unable to replicate this locally on my Nokia. Quite possibly it's not really a bug, just me being silly but I am lost in the process of finding what is wrong and inability to replicate is not helping.

RecordConfig (and the whole record start code):

        final isSupported = await _audioRecorder.isEncoderSupported(
          AudioEncoder.pcm16bits,
        );
        if (isSupported) {
          final String appDirPath =
              (await getApplicationDocumentsDirectory()).path;
          final String fullPath = '$appDirPath/test.pcm';
          const RecordConfig config = RecordConfig(
              encoder: AudioEncoder.pcm16bits,
              sampleRate: 44100,
              numChannels: 1);
          await _audioRecorder.start(
            config,
            path: fullPath,
          );
          return true;
        } else {
          toast("Unsupported encoder! (?)");
          return false;
        }

And the code to stop the fun is:

await _audioRecorder.stop();

Full Error Log:

Exception java.lang.IllegalStateException: Reply already submitted
  at io.flutter.embedding.engine.dart.DartMessenger$Reply.reply (DartMessenger.java)
  at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.success (MethodChannel.java)
  at com.llfbandit.record.methodcall.RecorderWrapper$stop$1.invoke (RecorderWrapper.java)
  at com.llfbandit.record.methodcall.RecorderWrapper$stop$1.invoke (RecorderWrapper.java)
  at com.llfbandit.record.record.AudioRecorder.onStop (AudioRecorder.java)
  at com.llfbandit.record.record.RecordThread.updateState (RecordThread.java)
  at com.llfbandit.record.record.RecordThread.onEncoderStop (RecordThread.java)
  at com.llfbandit.record.record.encoder.PassthroughEncoder$EncodeThread.encode (PassthroughEncoder.java)
  at com.llfbandit.record.record.encoder.PassthroughEncoder$EncodeThread.run (PassthroughEncoder.java)

To Reproduce
I tried but this is not something I can reproduce on my Nokia phone. Everything works like charm there. It is numerous devices failing (i.e. some Samsung phones, some Xiaomi ones, no clear pattern there).

Expected behavior
I would expect the code not to crash with the exception as defined in above Error Log

Additional context
no additional context

@Piotr12
Copy link
Author

Piotr12 commented Nov 21, 2023

🥱 ... if one is lazy or not smart much, he might miss the obvious: this is simply a result of calling stop one after/overlapping another. this looks like the case I experienced (tried with long recording and quick press of the save button twice, finally crashed my Nokia).

net: I am silly and lazy. Keeping it here for the world to see (and some folks similar to me find out the closed issue :))

@Piotr12 Piotr12 closed this as completed Nov 21, 2023
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

1 participant