Skip to content

MissingPluginException (MissingPluginException(No implementation found for method setSourceBytes on channel xyz.luan/audioplayers)) #1467

@moshOntong-IT

Description

@moshOntong-IT

Checklist

  • I read the troubleshooting guide before raising this issue
  • I made sure that the issue I am raising doesn't already exist

Current bug behaviour

What I am see right now is this MissingPluginException (MissingPluginException(No implementation found for method setSourceBytes on channel xyz.luan/audioplayers)) when I invoke the setSourceBytes

Expected behaviour

It should setSourceBytes must be invoke because according to this package, it will support windows platform. So I am expecting that this setSourceBytes is compatible in flutter windows.

Steps to reproduce

  1. Execute flutter run on the code sample
  2. ... Tap the audio file item
  3. ... The right drawer should be appear, then this drawer contains to play the audio

Code sample

Code sample
class __AudioPlayerNestedWidgetState
    extends ConsumerState<_AudioPlayerNestedWidget>
    with SingleTickerProviderStateMixin {
  late final AudioPlayer player;
  late final Animation<double> animation;
  late final AnimationController controller;

  bool seeking = false;

  final List<StreamSubscription> _subscriptions = [];

  @override
  void initState() {
    super.initState();

    player = AudioPlayer(playerId: widget.source.hashCode.toString());

    controller = AnimationController(
      duration: const Duration(milliseconds: 200),
      vsync: this,
    );

    animation = Tween<double>(begin: 1, end: 0).animate(controller);

   
    // FOCUS HERE, THIS LINE IS THE REASON THE BUG EXIST
    player.setSource(widget.source);

    _subscriptions.addAll([
      player.onPositionChanged.listen((event) {
        if (mounted && !seeking) {
          ref.read(_positionProvider.notifier).state = event;
        }
      }),
      player.onPlayerStateChanged.listen((state) {
        final isPlaying = state == PlayerState.playing;
        ref.read(_isPlayProvider.notifier).state = isPlaying;
        if (mounted) {
          if (isPlaying) {
            controller.forward();
          } else {
            controller.reverse();
          }
        }
      }),
      player.onDurationChanged.listen((event) {
        if (mounted) {
          ref.read(_durationProvider.notifier).state = event;
        }
      }),
    ]);
  }

  @override
  void dispose() {
    controller.dispose();
    super.dispose();
    player.dispose();

    for (final sub in _subscriptions) {
      sub.cancel();
    }
  }

  @override
  Widget build(BuildContext context) {
   /// my widget here
  }
}

Affected platforms

Windows

Platform details

Windows 11

AudioPlayers Version

3.0.1

Build mode

debug

Audio Files/URLs/Sources

http://167.172.64.61/v1/storage/buckets/64336229beb1032a5c38/files/6434e99ea1b73751ccb1/view?project=6432060389f51dde2154

Screenshots

image

Logs

my relevant logs
Full Logs
flutter: ERROR: MissingPluginException(No implementation found for method setSourceBytes on channel xyz.luan/audioplayers)
flutter:
flutter: STACK:#0      MethodChannel._invokeMethod
platform_channel.dart:313
flutter: <asynchronous suspension>

Flutter doctor:

[√] Flutter (Channel stable, 3.7.7, on Microsoft Windows [Version 10.0.22621.1413], locale en-PH)
  • Flutter version 3.7.7 on channel stable at C:\flutter
  • Upstream repository https://github.com/flutter/flutter.git
  • Framework revision 2ad6cd72c0 (5 weeks ago), 2023-03-08 09:41:59 -0800
  • Engine revision 1837b5be5f
  • Dart version 2.19.4
  • DevTools version 2.20.1

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
  • Android SDK at C:\Users\asnaw\AppData\Local\Android\sdk
  • Platform android-33, build-tools 33.0.0
  • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
  • Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)
  • All Android licenses accepted.

[√] Chrome - develop for the web
  • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.11.17)
  • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
  • Visual Studio Community 2019 version 16.11.32630.194
  • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2021.2)
  • Android Studio at C:\Program Files\Android\Android Studio
  • Flutter plugin can be installed from:
     https://plugins.jetbrains.com/plugin/9212-flutter
  • Dart plugin can be installed from:
     https://plugins.jetbrains.com/plugin/6351-dart
  • Java version OpenJDK Runtime Environment (build 11.0.12+7-b1504.28-7817840)

[√] VS Code (version 1.77.1)
  • VS Code at C:\Users\asnaw\AppData\Local\Programs\Microsoft VS Code
  • Flutter extension version 3.62.0

[√] Connected device (3 available)
  • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.22621.1413]
  • Chrome (web)      • chrome  • web-javascript • Google Chrome 111.0.5563.148
  • Edge (web)        • edge    • web-javascript • Microsoft Edge 112.0.1722.34

[√] HTTP Host Availability
  • All required HTTP hosts are available

• No issues found!

Related issues / more information

No response

Working on PR

no way

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions