Skip to content

Unhandled Exception: MissingPluginException for preparePlayer Method in audio_waveforms Plugin #338

Closed

Description

@AtharvaChavan04

After selecting an MP3 file in my Flutter application, I encountered an error in the terminal:

Unhandled Exception: MissingPluginException(No implementation found for method preparePlayer on channel simform_audio_waveforms_plugin/methods)
#0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:308:7)

#1 AudioWaveformsInterface.preparePlayer (package:audio_waveforms/src/base/audio_waveforms_interface.dart:100:18)

#2 PlayerController.preparePlayer (package:audio_waveforms/src/controllers/player_controller.dart:122:24)

#3 _AudioWaveState.initAudioPlayer (package:client/features/home/view/widgets/audio_wave.dart:25:5)

This error occurs when attempting to prepare the audio player using the preparePlayer method from the audio_waveforms plugin.
This is my code for preparePlayer:
void initAudioPlayer() async {
await playerController.preparePlayer(path: widget.path);
}

I have tried:
flutter clean
flutter pub get

Activity

  1. BayKIRMIZI commented on Sep 16, 2024

    @BayKIRMIZI

    Hello,

    I am experiencing the same issue with the audio_waveforms plugin. Specifically, I am encountering the following error:
    Here is a brief summary of what I have tried so far:

    Dependencies: I have included the latest version of flutter_audio_waveforms in my pubspec.yaml file and ran flutter pub get.
    Platform-Specific Configuration:
    Android: Verified that the plugin is correctly configured in android/app/build.gradle and that there are no issues with the MainActivity.java or MainActivity.kt files.
    iOS: Checked that the plugin is added to the Podfile and that pod install was run successfully.
    Code Implementation: Implemented the plugin in my Dart code and ensured that I am calling methods like preparePlayer after initializing the plugin.
    Despite following these steps, the issue persists. Here is the relevant code snippet where the issue occurs:
    ...
    @OverRide
    void initState() {
    super.initState();
    controller = PlayerController();
    _preparePlayer();
    ...
    }
    ...
    void _preparePlayer() async {
    ....
    controller.preparePlayer(
    path: _localPath,
    shouldExtractWaveform: true,
    );
    ...
    }
    ...

    Additional Information:

    Flutter Version: 3.24.3
    Plugin Version: 1.0.5
    Platform: Android
    I would greatly appreciate any guidance or solutions for resolving this issue. It seems that there might be an integration problem or a missing implementation in the plugin. Thank you for your assistance.

  2. himanshuGandhiSimform commented on Oct 10, 2024

    @himanshuGandhiSimform
    Contributor

    Hello, @BayKIRMIZI @AtharvaChavan04 Can you please try to delete the app and again install the app Before installing the app, please do flutter clean.

  3. ujas-m-simformsolutions commented on Oct 16, 2024

    @ujas-m-simformsolutions
    Contributor

    Closing this as duplicate of #273.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions