skip to Main Content

i use flutter and i used assets_audio_player library to run sounds in my app, it was working fine until last day, when i run the code it gives me PlatformException(OPEN,nul,null,null).

I tried to change the version and also tried to restart the app but nothing worked.

I used AudioWidget.assets() to run the sound, it was working fine but when version 3.0.6 was released it didn’t work and gives a rethrow error.

enter image description here

enter image description here

enter image description here

2

Answers


  1. I think it can be an Incompatibility or even some error that could happen with build files being not updated or synchronised.

    Just to have a clear conscience, please, on your project terminal, run the very old classic:

    flutter clean
    

    Then, run

    flutter pub get
    

    Stop your running project and rebuild your application

    In fact, if it doesn’t solve your problem, i would suggest you to downgrade the assets_audio_player to the previous version to when it was working.

    Update me if none of this solve your problem.

    Login or Signup to reply.
  2. I solved this problem by changing my asset String:

    ‘sounds/x.ogg’ to -> ‘assets/sounds/x.ogg’

    make sure your audio path is exactly like what you wrote in pupspec.yaml

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search