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

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

Closed
2 tasks done
moshOntong-IT opened this issue Apr 11, 2023 · 3 comments · Fixed by #1601
Labels
bug platform-windows Affects the windows platform

Comments

@moshOntong-IT
Copy link

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

@pro100andrey
Copy link

pro100andrey commented Apr 11, 2023

Hi, after upgrade in to v4.0 version, I have the similar issue after call _player?.dispose(); method.

Unhandled Exception: MissingPluginException(No implementation found for method dispose on channel xyz.luan/audioplayers)

Thanks

@Gustl22
Copy link
Collaborator

Gustl22 commented Apr 11, 2023

@pro100andrey you're right! I missed the implementation to dispose the players for many platforms. Thanks for noting!

@Gustl22
Copy link
Collaborator

Gustl22 commented Apr 11, 2023

@moshOntong-IT Bytes source is only supported for Android. But we would be happy if anyone implements this: #1269

Gustl22 added a commit that referenced this issue Apr 11, 2023
# Description

The implementation to dispose a player on the native side was missing for many platforms.

See #1467 (comment)
@Gustl22 Gustl22 added the platform-windows Affects the windows platform label Sep 23, 2023
Gustl22 added a commit that referenced this issue Sep 23, 2023
# Description

This PR will support "setSourceBytes" method for Windows OS.

## Related Issues
#1269 
Closes #1600
Closes #1467

---------

Co-authored-by: Gustl22 <[email protected]>
Gustl22 pushed a commit that referenced this issue Sep 26, 2023
# Description

This PR will support "setSourceBytes" method for Windows OS.

## Related Issues
#1269
Closes #1600
Closes #1467

---------

Co-authored-by: Gustl22 <[email protected]>
(cherry picked from commit a9e1471)
Gustl22 added a commit that referenced this issue Nov 14, 2023
# Description

This PR will support "setSourceBytes" method for Windows OS.

## Related Issues
#1269 
Closes #1600
Closes #1467

---------

Co-authored-by: Gustl22 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug platform-windows Affects the windows platform
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants