ardera / flutter-pi

A light-weight Flutter Engine Embedder for Raspberry Pi that runs without X.
MIT License
1.48k stars 153 forks source link

Having Issues with flame_audio plugin. What am I missing? #379

Closed MatthewJones517 closed 4 months ago

MatthewJones517 commented 4 months ago

I am trying to get flutter-pi working with something I whipped with the flame and flame_audio packages. I've got it 95% of the way there. I get the following error every time a sound plays:

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: MissingPluginException(No implementation found for method create on channel xyz.luan/audioplayers)
#0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:320)
<asynchronous suspension>
#1      AudioplayersPlatform.create (package:audioplayers_platform_interface/src/audioplayers_platform.dart:18)
<asynchronous suspension>
#2      AudioPlayer._create (package:audioplayers/src/audioplayer.dart:161)
<asynchronous suspension>

I found the following issues that appears to be related: https://github.com/ardera/flutter-pi/issues/120 https://github.com/ardera/flutter-pi/issues/233

It seems like the flame_audio package uses audioplayer as a dependency. Given I've seen several threads about it here, I'm guessing it's related to flutter_pi. Especially everything works fine on my Ubuntu dev machine.

I'm guessing this is related to the issues above. I just want to confirm that so I don't keep troubleshooting. :)

MatthewJones517 commented 4 months ago

Okay, I'm 99% sure I've sorta found the root cause on this.

It looks like pull request 345 is still open and it implies that audioplayers v5 isn't supported in the current release.

Looking at the flame_audio package, it appears to use audioplayers 5.

Any idea on when that PR is going to get merged in and released? I'm trying to decide what direction to take my project. :)

ardera commented 4 months ago

Hey, you're right, #345 was the cause of this. Just merged it đŸ˜„

MatthewJones517 commented 4 months ago

Thanks so much! I appreciate it. :)