颤振错误:没有名称为"onMediaDeviceChanged"的命名参数。颤振上下文:找到此候选项,但参数不匹配


Performing hot reload...
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/agora_uikit-1.1.0/lib/controllers/rtc_event_handlers.dart:140:6: Error: No named parameter
with the name 'onMediaDeviceChanged'.
}, onMediaDeviceChanged: (deviceType) {
^^^^^^^^^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/agora_rtc_engine-6.1.0/lib/src/agora_rtc_engine.dart:1537:9: Context: Found this candidate,
but the arguments don't match.
const RtcEngineEventHandler({
^^^^^^^^^^^^^^^^^^^^^
Try again after fixing the above error(s).
Performing hot reload...
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/agora_uikit-1.1.0/lib/controllers/rtc_event_handlers.dart:140:6: Error: No named parameter
with the name 'onMediaDeviceChanged'.
}, onMediaDeviceChanged: (deviceType) {
^^^^^^^^^^^^^^^^^^^^
/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/agora_rtc_engine-6.1.0/lib/src/agora_rtc_engine.dart:1537:9: Context: Found this candidate,
but the arguments don't match.
const RtcEngineEventHandler({
^^^^^^^^^^^^^^^^^^^^^
Try again after fixing the above error(s).
Application finished.

我正在使用agora创建我的flutter应用程序中的视频通话功能。它应该为每次调用自动生成令牌。我用Node.js创建了一个后端服务器但是当我试图运行我的应用程序时,我得到一个关于'onMediaDeviceChanged'的错误。我不太明白。请帮助。

看起来最新版本的agora_uikit是1.1.0与flutter最新sdk版本3.3.10有问题。尝试降级您的agora_uikit依赖,如果您使用的是1.1.0版本,尝试降级到agora_uikit: ^1.0.2,并在pubspec.yml文件中添加permission_handler: ^9.2.0,然后运行flutter pub get

Agora是我遇到过的最烂的库。同样的问题。

如果你使用agora_uikit包,你有这些问题;您可以尝试删除agora_uikit包并获得agora_rtc_engine。在我的例子中,它是固定的。好运。

最新更新