ardera / flutter-pi

A light-weight Flutter Engine Embedder for Linux Embedded that runs without X11 or Wayland.
MIT License
1.57k stars 159 forks source link

Audioplayers MissingPluginException #420

Open Winterteq opened 3 months ago

Winterteq commented 3 months ago

Hey!

flutter-pi for the most part has worked great for my app. it seems to be running (albeit a little slow because of my old RPI3!).

However I am using the audioplayers package on my app - it works fine when I run on my windows machine, but when I build on WSL and move the bundle across to my rpi and run with flutter-pi I get the following error:

`[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:332:7)

#1 AudioplayersPlatform.create (package:audioplayers_platform_interface/src/audioplayers_platform.dart:18.5) #2 AudioPlayer._create (package:audioplayers/src/audioplayer.dart:161:7) ` To confirm the steps I have taken is: 1. Developed functioning app on Windows dev machine using libraries that all support linux. 2. Used WSL with latest flutter stable build to build the code using `flutter build bundle` 3. Transferred the assets from the "build" folder in my project over to my raspberry pi 4. used "flutter-pi build The app runs and appears on the screen, but the features requiring the audioplayers app are throwing this error. any help would be appreciated!
HSVDO commented 3 months ago

Hi,

I ran into this problem, too.

In addition to the points mentioned above:

I followed the instructions given in the readme and verified the audio setup using gst-launch-1.0 -v playbin uri=file:///home/pi/my_apps_flutter_assets/assets/path_to_audio.mp3.

Using gst-launch everything works fine and the audiofiles are played as expected.

I tried both audioplayers versions: ^5.0.0 and ^6.0.0 with the same error.

Any ideas on how to fix this would be appreciated :)