-
Notifications
You must be signed in to change notification settings - Fork 52
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
getting PlatformException(channel-error, Unable to establish connection on channel: "dev.flutter.pigeon.wakelock_plus_platform_interface.WakelockPlusApi.toggle"., null, null) error when running test cases #67
Comments
For those who are facing such issue, I was able to pass the test cases by making below change in my test file. I have replaced
to
|
I face this error also when using the plugin in production. I'm using |
@luckyhandler @shivamtiwari-ttn is there any fix for it ? |
@diegotori Most likely related to Flutter upgrade (3.24.X) @luckyhandler Have you upgraded Flutter version recently? |
@shivamtiwari-ttn please upgrade your The latest ones are guaranteed to be compatible with Flutter When upgrading, also run |
Thanks @diegotori, we will try to upgrade versions. So, it be caused because of mismatch in versions between platform interface and the package itself, right?
wakelock_plus:
dependency: "direct main"
description:
name: wakelock_plus
sha256: f268ca2116db22e57577fb99d52515a24bdc1d570f12ac18bb762361d43b043d
url: "https://pub.dev"
source: hosted
version: "1.1.4"
wakelock_plus_platform_interface:
dependency: transitive
description:
name: wakelock_plus_platform_interface
sha256: "422d1cdbb448079a8a62a5a770b69baa489f8f7ca21aef47800c726d404f9d16"
url: "https://pub.dev"
source: hosted
version: "1.2.1" |
Once you upgrade both, it should work itself out. |
I am using wakelock_plus for one of my classes to keep player screen on. Test cases related to that file are failing. I was earlier using wakelock, recently updated to wakelock_plus. In the test case file I have a setupAll method where earlier for wakelock 'wakelock_macos' was used for MethodChannel name like below.
for this test cases were passed successfully.
After comparing the wakelock and wakelock_plus libraries, I attempted to utilise the MethodChannel named 'wakelock_plus_macos' for wakelock_plus in the same way that we used it for wakelock.
const channel = MethodChannel('wakelock_plus_macos');
But test cases are failing with below error:
PlatformException(channel-error, Unable to establish connection on channel: "dev.flutter.pigeon.wakelock_plus_platform_interface.WakelockPlusApi.toggle"., null, null)
Now if I use 'dev.flutter.pigeon.wakelock_plus_platform_interface.WakelockPlusApi.toggle' as the MethodChannel name like
const channel = MethodChannel('dev.flutter.pigeon.wakelock_plus_platform_interface.WakelockPlusApi.toggle');
I am getting another error:
What should be used for MethodChannel to run test cases successfully
The text was updated successfully, but these errors were encountered: