creativecreatorormaybenot/wakelock

Unhandled exception during toggle on Android

Karmalakas opened this issue · 1 comments

Just with the code sample from examples page, when trying to toggle, I get

E/flutter (23302): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(channel-error, Unable to establish connection on channel., null, null)
E/flutter (23302): #0      WakelockApi.toggle (package:wakelock_platform_interface/messages.dart:89:7)
E/flutter (23302): <asynchronous suspension>
E/flutter (23302): #1      MethodChannelWakelock.toggle (package:wakelock_platform_interface/method_channel_wakelock.dart:20:5)
E/flutter (23302): <asynchronous suspension>

Tried both Wakelock.disable() and Wakelock.toggle(on: false)

OK, so I noticed this happening with some other plugins and completely restarting the build solved issue. I gave another try for wakelock package and it also worked. Closing this issue