Skip to content

[bug] Android setMicrophoneEnable produce MissingPluginException #938

@Pluxury

Description

@Pluxury

Describe the bug
When I call

 final currentMicState = localParticipant.isMicrophoneEnabled();

 await localParticipant.setMicrophoneEnabled(!currentMicState);

I get the following error

════════ Exception caught by services library ══════════════════════════════════
The following MissingPluginException was thrown while de-activating platform stream on channel io.livekit.audio.visualizer/eventChannel-57f0c280-e5dc-4c6e-8eca-6074c9b5498a-5640a1b9-8d1d-4645-9907-9d02f00732d1:
MissingPluginException(No implementation found for method cancel on channel io.livekit.audio.visualizer/eventChannel-57f0c280-e5dc-4c6e-8eca-6074c9b5498a-5640a1b9-8d1d-4645-9907-9d02f00732d1)
When the exception was thrown, this was the stack:
#0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:365:7)
platform_channel.dart:365
#1 EventChannel.receiveBroadcastStream. (package:flutter/src/services/platform_channel.dart:727:11)
platform_channel.dart:727
═══════════════════════════════════════════════════════════════════════════════

Which in turn causes the application to crash.
Please note that this error appears only on Android. On iOS, it works as needed

UPD:
This error occurs after the call await _visualizer?.stop() in SoundWaveformWidget

To Reproduce
You just need to connect to the room and try to mute the microphone.
This also reproduce on example project

Expected behavior
There should be no exception.

Platform information

  • Flutter version: 3.38.3
  • Plugin version: 2.5.4
  • Flutter target OS: Android 12+ real device

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions