Closed pitazzo closed 1 year ago
Thank you for your detailed report! Unfortunately I don't have the time to try until the error is thrown. If you have clear reproduction steps, when the error occurs, we can help you much better and fix it.
FYI: #1322
Yeah, I know that with no steps, this is like looking for a needle in a haystack. Will follow the other issue, as seems to be the same problem. I do not know how I did not find out that issue without opening this one. Thanks!
This error will be triggered when playing audio with play () for several times in a short time.
Checklist
Sometimes, at the time of playing a sound, a Platform exception regarding
MediaPlayer
is raised.Current bug behaviour
At the time of playing a sound, following exception is thrown:
The stack trace was this:
As it was reported by our remote crash reporting tool, we do not know whether the sound is actually played.
Expected behaviour
No exception should be thrown. Sound should play.
Steps to reproduce
Unfortunately, we have not been able to reproduce the issue at the office. From the metrics we get from our crash reporting tool, the issue is quite rare compared to the number of sounds played with no problems. I've attached the code of our real service in charge of playing the sound.
Code sample
```dart import 'package:audioplayers/audioplayers.dart'; import 'package:injectable/injectable.dart'; import 'package:mxa_flutter_core/services/logger/logger_service.dart'; import 'package:mxa_flutter_core/services/persistence/persistence_service.dart'; import 'package:mxa_flutter_core/services/sound/sound_config.dart'; import 'package:mxa_flutter_core/services/sound/sound_service.dart'; @Singleton(as: SoundService) class AudioplayersSoundService extends SoundService { final PersistenceService _persistenceService; final LoggerService _loggerService; final SoundConfig _soundConfig; final AudioPlayer _player = AudioPlayer(); final MapLogs
Full Logs
Flutter doctor: ``` [✓] Flutter (Channel stable, 3.3.4, on macOS 13.0.1 22A400 darwin-arm, locale es-ES) • Flutter version 3.3.4 on channel stable at /Users/pitazzo/SDKs/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision eb6d86ee27 (7 weeks ago), 2022-10-04 22:31:45 -0700 • Engine revision c08d7d5efc • Dart version 2.18.2 • DevTools version 2.15.0 [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3) • Android SDK at /Users/pitazzo/SDKs/android • Platform android-33, build-tools 30.0.3 • ANDROID_HOME = /Users/pitazzo/SDKs/android • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 14.1) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 14B47b • CocoaPods version 1.11.2 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 2021.2) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840) [✓] VS Code (version 1.73.1) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.52.0 [✓] Connected device (3 available) • M2006C3LG (mobile) • RWYDO7Z9IRAQMBDU • android-arm • Android 10 (API 29) • macOS (desktop) • macos • darwin-arm64 • macOS 13.0.1 22A400 darwin-arm • Chrome (web) • chrome • web-javascript • Google Chrome 106.0.5249.119 [✓] HTTP Host Availability • All required HTTP hosts are available • No issues found! ```Environment information
^1.1.1
Platform 1: android
release