audioplayers
audioplayers copied to clipboard
Constant crash on android 6.0.1
Checklist
- [X] I read the troubleshooting guide before raising this issue
- [X] I made sure that the issue I am raising doesn't already exist
Current bug behaviour
After the update to audioplayers 5.2.1, there is constant crash of IlllegalStateException on Android 6.0.1 devices.
Expected behaviour
The player should play the audio from assets.
Steps to reproduce
- Execute
flutter run
on the code sample - ...
- ...
Code sample
Future
Affected platforms
Android
Platform details
Platform: Android 6.0.1
AudioPlayers Version
5.2.1
Build mode
release
Audio Files/URLs/Sources
No response
Screenshots
No response
Logs
Fatal Exception: io.flutter.plugins.firebase.crashlytics.FlutterError: PlatformException(AndroidAudioError, null, java.lang.IllegalStateException at android.media.MediaPlayer.prepareAsync(Native Method) at n9.i.d() at n9.o.N() at m9.m.J() at m9.m.n() at m9.m$b.b() at m9.m$b.invoke() at m9.m$d.invokeSuspend() at kotlin.coroutines.jvm.internal.a.resumeWith() at d9.d1.run() at kotlinx.coroutines.internal.n.run() at kotlinx.coroutines.scheduling.k.run() at kotlinx.coroutines.scheduling.a.M() at kotlinx.coroutines.scheduling.a$c.d() at kotlinx.coroutines.scheduling.a$c.n() at kotlinx.coroutines.scheduling.a$c.run() , null) at StandardMethodCodec.decodeEnvelope(message_codecs.dart:652) at MethodChannel._invokeMethod(platform_channel.dart:310) at AudioPlayer.stop(audioplayer.dart:226) at AudioPlayer.release(audioplayer.dart:242) at AudioPlayer.dispose(audioplayer.dart:405) at AudioManager._disposeMusic(audio_manager.dart:112) at AudioManager.dispose(audio_manager.dart:99)
Related issues / more information
No response
Working on PR
no way
Try to set the release mode before playing.
Also use await
before setReleaseMode
and play
.
See also #1526
Try to set the release mode before playing. Also use
await
beforesetReleaseMode
andplay
.See also #1526
Ok, I'll try with await, but I don't think that would be cause since this only happens on Android 6.0.1
@ehtiqamar did you find a solution? I am also struggling with this for Android 6 devices in specific
@ehtiqamar did you find a solution? I am also struggling with this for Android 6 devices in specific
nope, I tried the above solution but it is still crashing