-
Notifications
You must be signed in to change notification settings - Fork 157
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
Android crash : Fatal Exception: java.lang.IllegalStateException Reply already submitted #375
Comments
Hi @Tom3652, Thanks for filling the issue. Can you please send me reproducible steps or audio files? Also, please share your flutter—v console output. |
Thanks for the quick reply, however as i said it happens on my live app and on Android devices, i have no ways to reproduce it unfortunately 😐 I was hoping you would know what is the "reply already submitted" error... |
I am adding the |
@Tom3652, We will investigate this issue and try to solve it as soon as possible. |
Hello @Tom3652, I just want to know if you are using the stopAllPlayer method in your app to stop all active players together. |
Hello both of you, thank you very much for your interest and answers. I am actually not using final PlayerController controller = PlayerController();
try {
await controller.preparePlayer(path: audioFile);
controller.setFinishMode(finishMode: FinishMode.stop);
await controller.startPlayer();
} catch (e) {
print("error playing audio file : $e");
}
@override
void dispose() {
controller.dispose();
super.dispose();
} In Another class : final PlayerController controller = PlayerController();
StreamSubscription<PlayerState>? playerStateSubscription;
AnimationController? playAnimator;
double waveWidth = 0;
String filePath = "value";
Future<void> init() async {
waveWidth = widget.width - 60;
if (mounted) {
playAnimator = AnimationController(
vsync: this, duration: const Duration(milliseconds: 250));
print("File path : $filePath");
await controller.preparePlayer(
path: filePath,
shouldExtractWaveform: true,
noOfSamples: _playerWaveStyle.getSamplesForWidth(waveWidth));
playerStateSubscription = controller.onPlayerStateChanged.listen((state) {
if (mounted) {
stateNotifier.value = state;
if (state == PlayerState.paused && mounted) {
playAnimator?.reverse();
}
}
});
durationListener = controller.onCurrentDurationChanged.listen((millis) {
positionNotifier.value =
getAudioDuration(Duration(milliseconds: millis));
});
int waiting = Platform.isAndroid ? 1000 : 0;
// On Android
Future.delayed(Duration(milliseconds: waiting)).then((value) async {
int millis = await controller.getDuration(DurationType.max);
positionNotifier.value =
getAudioDuration(Duration(milliseconds: millis));
print(
"Duration for file $filePath : ${positionNotifier.value}");
});
stopListener = AudioPlayerManager.instance.onStopPlayerListener.stream
.listen((audioFile) async {
if (controller.playerState.isPaused && mounted) {
playAnimator?.reverse();
}
if (audioFile != filePath &&
(controller.playerState.isPlaying ||
controller.playerState.isPaused) &&
mounted) {
await controller.pausePlayer();
}
});
if (mounted) {
setState(() {});
}
}
}
@override
void initState() {
init();
super.initState();
}
@override
void dispose() {
controller.dispose();
playerStateSubscription?.cancel();
durationListener?.cancel();
stopListener?.cancel();
playAnimator?.dispose();
super.dispose();
}
Future<void> onTap() async {
if (filePath.isNotEmpty) {
HapticFeedback.mediumImpact();
controller.playerState.isPlaying ? pause() : play();
}
}
Future<void> pause() async {
await controller.pausePlayer();
playAnimator!.reverse();
}
Future<void> play() async {
AudioPlayerManager.instance.onStopPlayerListener.add(filePath);
controller.setFinishMode(finishMode: FinishMode.pause);
await controller.startPlayer();
playAnimator!.forward();
}
Now i wonder if the error is to not Thanks a lot for your help |
Hi both of you, i have got a new crash today that is on the
|
@Tom3652, Thanks for providing the information. We are working on this issue and will update you once we find a solution. |
Hi @jay-simformsolutions thank you very much i really apreciate it. |
I simply add the proportion here :
And so far no other methods are revealing this issue 🙏 and no crashes at all on iOS ! Note : i don't add the new impacted phones since it's probably not device-specific / android-version-specific, but if i will provide all the info i can give if you need it of course |
Describe the bug
Thanks for the package !
I have multiple crashes from my live app affecting my Android users.
Here is the StackTrace :
To Reproduce
Unfortunately it never happened during the debug neither of the internal testing of the app so i have no clue on how to reproduce it...
Expected behavior
I would like the app to not crash.
Smartphone (please complete the following information):
Screenshots
Additional context
The text was updated successfully, but these errors were encountered: