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

PlatformException(AndroidAudioError, MEDIA_ERROR_UNKNOWN {what:-38} -> followed by a TimeoutException #1860

Open
2 tasks done
IhabMks opened this issue Nov 21, 2024 · 0 comments
Labels

Comments

@IhabMks
Copy link

IhabMks commented Nov 21, 2024

Checklist

  • I read the troubleshooting guide before raising this issue
  • I made sure that the issue I am raising doesn't already exist

Current bug behaviour

I had this error one time, but couldn't reproduce it for more detailed of what happened.
Below is the full error:
main.<fn> io.flutter.plugins.firebase.crashlytics.FlutterError - PlatformException(AndroidAudioError, MEDIA_ERROR_UNKNOWN {what:-38}, MEDIA_ERROR_UNKNOWN {extra:0}, null)

And just after it:
Fatal Exception: io.flutter.plugins.firebase.crashlytics.FlutterError TimeoutException after 0:00:30.000000: Future not completed FirebaseCrashlytics.recordError (firebase_crashlytics.dart:119) main. (main.dart:75)

Note:

  • This error is from android users.
  • I only use files to play audios, so i copy the file path after it has been created and fully written, as shown below:
Uint8List? audioFile = getAudioFileFromDB();
      if (audioFile != null) {
        final tempDir = await getTemporaryDirectory(id);
        File audioFileMp3 = await File('${tempDir.path}/${id}.mp3');
        url = audioFileMp3.path;
        if (!audioFileMp3.existsSync()) {
          try {
            audioFileMp3.createSync();
            audioFileMp3.writeAsBytesSync(audioFile);
          } catch (e) {
            if (logDebug) logger.e("play file=${audioFileMp3.path} errorWritingFile");
          }
        }
      }

And then use this url:

if (url == null) return;
await _audioPlayer.play(UrlSource(url))

UPDATE:

  • Found the error related to the TimeoutException after 0:00:30.000000: Future not completed, it was triggered when we do a seekTo when the audioPlayer is on stopped state.
    Not sure if this would resolves the {what:-38}, but i'll keep testing and digging deeper into it.

Expected behaviour

No errors.

Steps to reproduce

  1. Execute flutter run on the code sample
  2. ...
  3. ...

Code sample

Code sample
void main() {
}

Affected platforms

Android

Platform details

No response

AudioPlayers Version

6.0.0

Build mode

release

Audio Files/URLs/Sources

No response

Screenshots

No response

Logs

my relevant logs
Full Logs
my full logs or a link to a gist

Flutter doctor:

Output of: flutter doctor -v

Related issues / more information

No response

Working on PR

no way

@IhabMks IhabMks added the bug label Nov 21, 2024
@IhabMks IhabMks changed the title PlatformException(AndroidAudioError, MEDIA_ERROR_UNKNOWN {what:-38} PlatformException(AndroidAudioError, MEDIA_ERROR_UNKNOWN {what:-38} -> followed by a TimeoutException Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant