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

does not work at flutter-pi #1154

Open
BigGitWorld opened this issue Jun 8, 2022 · 4 comments
Open

does not work at flutter-pi #1154

BigGitWorld opened this issue Jun 8, 2022 · 4 comments
Labels
bug platform-linux Affects the linux platform waiting for report Wait for the author to respond to the conversation

Comments

@BigGitWorld
Copy link

Hi!
I'm using the [1.0.0-rc.4](https://pub.dev/packages/audioplayers/versions/1.0.0-rc.4) that works fine in an Linux ubuntu desktop.
but when I use it in a flutter-pi project, it shows me the below error:

[compositor] Preferred framebuffer depth for hardware cursor is not supported by flutter-pi.
[ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: MissingPluginException(No implementation found for method setSourceUrl on channel xyz.luan/audioplayers)
#0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:165:7)
<asynchronous suspension>
#1      AudioPlayer.play (package:audioplayers/src/audioplayer.dart:112:5)
<asynchronous suspension>

Do I have to do something to work in raspberrypi by flutter-pi?
Note: sound is enabled in my raspberry pi.

@BigGitWorld BigGitWorld added the bug label Jun 8, 2022
@BigGitWorld BigGitWorld changed the title does not work on flutter-pi does not work at flutter-pi Jun 8, 2022
@luanpotter
Copy link
Member

No implementation found for method setSourceUrl

That is very interesting, it appears Flutter is not recognizing your flutter-pi as "linux" in order for audioplayers to use the correct binding.
Could you please try using any other flutter dependencies with native linux code?
I wonder if this is an issue with Flutter itself.

@BigGitWorld
Copy link
Author

BigGitWorld commented Jun 11, 2022

That is very interesting, it appears Flutter is not recognizing your flutter-pi as "linux" in order for audioplayers to use the correct binding.

But why this has to be happened?

Could you please try using any other flutter dependencies with native linux code? I wonder if this is an issue with Flutter itself.

What do you mean exactly? Do you mean I use audioplayers_linux package directly in my project? or use another flutter package with a native linux code?
if the second is right, I'm using other packages such as flutter_libserialport in my flutter-pi project and it is working fine.

I found a similar issue in the flutter-pi page: flutter-pi sound support.
Can you clarify how do I have to use it?

@luanpotter
Copy link
Member

or use another flutter package with a native linux code

yes that is what I meant. interesting, I don't understand why flutter_libserialport works and AP doesn't. I compared our configurations for the linux binding; the only difference is that libserialport does not use federation and we do. But that should not affect anything.

I just tried running our example (packages/audioplayers/example) on my Arch Linux and it worked. Could you please try clonning the repo and running that on your raspberry pi? I wonder if something else is causing interference.

@Gustl22 Gustl22 added platform-linux Affects the linux platform waiting for report Wait for the author to respond to the conversation stale Automatically close this issue, if no activity is recognized and removed stale Automatically close this issue, if no activity is recognized labels Sep 27, 2022
@HSVDO
Copy link

HSVDO commented May 31, 2024

Hey, I ran into a similar issue using flutter-pi and audioplayers package.

  • Flutter 3.19.5 stable
  • audioplayers: ^4.0.0, ^5.0.0 and ^6.0.0
  • Raspberry Pi 3B with flutter-pi
  • Raspbian 11 (Bullseye)

I tried my own code - running on all platforms except Linux using flutter-pi pretty fine - and I also deployed the audioplayers/example project using flutter-pi. The example's UI works properly, when pressing the play button the same error is thrown:

[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) <asynchronous suspension>
#1   AudioplayersPlatform.create (package:audioplayers_platform_interfaces/src/audioplayers_platform.dart:18) <asynchronous suspension>
#2   AudioPlayer._create (package:audioplayers/src/audioplayer.dart:175) <asynchronous suspension>

In addition I checked the platform detected by flutter. The result is 'linux'.

While writing this comment, I found this issue in the flutter-pi repo which might explain the problems. I will try to understand what's happening there in the next days. But as I am new to the platform channel mechanic I can't promise any valuable results 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug platform-linux Affects the linux platform waiting for report Wait for the author to respond to the conversation
Projects
None yet
Development

No branches or pull requests

4 participants