[Solved] Flutter just_audio plugin Error: Unhandled Exception: Unable to load asset

2022/08/07 23:57

Error

I/ExoPlayerImpl(20362): Init 262288e [ExoPlayerLib/2.17.1] [generic_x86_64, Android SDK built for x86_64, Google, 29]

I/ExoPlayerImpl(20362): Release 262288e [ExoPlayerLib/2.17.1] [generic_x86_64, Android SDK built for x86_64, Google, 29] [goog.exo.core, goog.exo.exoplayer, goog.exo.decoder, goog.exo.datasource, goog.exo.extractor]

E/flutter (20362): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: Unable to load asset: assets/audio/success.wav

E/flutter (20362): #0      PlatformAssetBundle.load (package:flutter/src/services/asset_bundle.dart:237:7)

E/flutter (20362): <asynchronous suspension>

E/flutter (20362): #1      UriAudioSource._loadAsset (package:just_audio/just_audio.dart:2215:14)

E/flutter (20362): <asynchronous suspension>

E/flutter (20362): #2      UriAudioSource._setup (package:just_audio/just_audio.dart:2172:22)

E/flutter (20362): <asynchronous suspension>

E/flutter (20362): #3      AudioPlayer._load (package:just_audio/just_audio.dart:815:7)

E/flutter (20362): <asynchronous suspension>

E/flutter (20362): #4      AudioPlayer._setPlatformActive.setPlatform (package:just_audio/just_audio.dart:1421:28)

E/flutter (20362): <asynchronous suspension>

E/flutter (20362):

Solution

just_audio plugin doesn’t work for .wav audio format. You should use .mp3 format file instead.

声明:未经允许不得进行商业转载,非商业转载请注明出处和链接。

Leave a Reply

Back to top