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。在我的例子中,它是固定的。好运。