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

【Flutter】-FluterSDK 2.8.1 运行失效 #980

Closed
MrDgbot opened this issue Jan 26, 2022 · 2 comments
Closed

【Flutter】-FluterSDK 2.8.1 运行失效 #980

MrDgbot opened this issue Jan 26, 2022 · 2 comments
Assignees

Comments

@MrDgbot
Copy link

MrDgbot commented Jan 26, 2022

报错文件:
lib/engine/dokit_binding.dart

报错信息

../lib/engine/dokit_binding.dart:129:12: Error: The method 'setMockMessageHandler' isn't defined for the class 'BinaryMessenger'. - 'BinaryMessenger' is from 'package:flutter/src/services/binary_messenger.dart' ('../../../../fvm/versions/stable/packages/flutter/lib/src/services/binary_messenger.dart'). Try correcting the name to the name of an existing method, or defining a method named 'setMockMessageHandler'. origin.setMockMessageHandler(channel, handler); ^^^^^^^^^^^^^^^^^^^^^ ../lib/engine/dokit_binding.dart:139:52: Error: The argument type 'Future? Function(ByteData?)?' can't be assigned to the parameter type 'Future? Function(ByteData?)' because 'Future? Function(ByteData?)?' is nullable and 'Future? Function(ByteData?)' isn't. - 'Future' is from 'dart:async'. - 'ByteData' is from 'dart:typed_data'. return origin.checkMockMessageHandler(channel, handler);
报错分析: setMockMessageHandler 和 checkMockMessageHandler 方法迁移

// Looking for setMockMessageHandler or checkMockMessageHandler?
// See this shim package: packages/flutter_test/lib/src/deprecated.dart

报错文件:
lib/engine/dokit_http.dart

报错信息:

error: A value of type 'Future Function(String, int, String, String)?' can't be assigned to a variable of type 'Future Function(String, int, String, String?)?'. (invalid_assignment at [dokit] lib/engine/dokit_http.dart:84)

报错分析:
方法f 类型问题
as转换
origin.authenticateProxy = f as Future Function(String host, int port, String scheme, String? realm)?;

@MrDgbot
Copy link
Author

MrDgbot commented Jan 26, 2022

@xu984386604

@zhugeafanti
Copy link

zhugeafanti commented Feb 18, 2022

hello,谢谢反馈的问题。这个问题有过修复,暂还未合到master分支。
1、如果您下载了工程源码的话,可以切换到feature/dev_flutter分支试一试。在这个分支上注掉了失效方法setMockMessageHandler。
2、如果使用版本方式引入dokit的话,可以将版本指向:dokit 0.8.1-nullsafety.0 试一下。
https://pub.dev/packages/dokit/versions/0.8.1-nullsafety.0

@maxiee maxiee closed this as completed Feb 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants