AgoraIO-Extensions / Agora-Flutter-SDK

Flutter plugin of Agora RTC SDK for Android/iOS/macOS/Windows
https://pub.dev/packages/agora_rtc_engine
MIT License
739 stars 382 forks source link

"type 'int' is not a subtype of type 'Iterable<dynamic>' " when I call enumeratePlaybackDevices() or enumerateRecordingDevices() #2042

Open HarukaOki opened 2 weeks ago

HarukaOki commented 2 weeks ago

Version of the agora_rtc_engine

6.3.2

Platforms affected

Steps to reproduce

To be honest, I haven't figured out a reliable way to reproduce this issue. However, occasionally, when I call getAudioDeviceManager().enumeratePlaybackDevices() or getAudioDeviceManager().enumerateRecordingDevices() on MacOS, an error log appears. I'm a beginner and not very familiar with creating issues like this, so please feel free to let me know if there's any missing information or anything you're concerned about.

Expected results

I hope no such error occurs, or it becomes clearer what I should fix when an error does occur.

Actual results

Occasionally, an error occurs. Please refer to the log below for details.

Code sample

Code sample ```dart ... late RtcEngine agoraEngine; try { agoraEngine = createAgoraRtcEngine(); await agoraEngine.initialize( const RtcEngineContext( appId: '0cd8cb48f23b418eabdfa90730f956bd', ), ); } on Exception catch (e) { Log.warn( 'failed to create RtcEngine', e: e, fields: { 'type': 'AgoraEngine', }, ); rethrow; } if(Platform.isMacOS) { final audioInputDeviceInfoList = await ragorEngine.getAudioDeviceManager().enumerateRecordingDevices(); } ... ```

Screenshots or Video

Screenshots / Video demonstration [Upload media here]

Logs

Logs This is a typical Firebase Crashlytics log. ```console Non-fatal Exception: FlutterError type 'int' is not a subtype of type 'Iterable' 0x0 DeviceInfoListExt.fill + 15 (audio_device_manager_impl.dart:15) 1 ??? 0x0 AudioDeviceManagerImpl.enumerateRecordingDevices + 71 (audio_device_manager_impl.dart:71) 2 ??? 0x0 AgoraEngine.getAvailableInputDevices + 690 (agora.dart:690) ... ```

Flutter Doctor output

Doctor output ```console [✓] Flutter (Channel stable, 3.24.3, on macOS 14.3 23D56 darwin-arm64, locale ja-JP) • Flutter version 3.24.3 on channel stable at /Users/harukaoki/development/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 2663184aa7 (3 weeks ago), 2024-09-11 16:27:48 -0500 • Engine revision 36335019a8 • Dart version 3.5.3 • DevTools version 2.37.3 [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0) • Android SDK at /Users/harukaoki/Library/Android/sdk • Platform android-35, build-tools 33.0.0 • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11609105) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 15.4) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 15F31d • CocoaPods version 1.15.2 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 2024.1) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11609105) [✓] VS Code (version 1.94.0) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.98.0 [✓] Connected device (4 available) • iPhone (8) (mobile) • 00008020-001124CE3CE9002E • ios • iOS 17.6.1 21G93 • macOS (desktop) • macos • darwin-arm64 • macOS 14.3 23D56 darwin-arm64 • Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin • macOS 14.3 23D56 darwin-arm64 • Chrome (web) • chrome • web-javascript • Google Chrome 129.0.6668.90 [✓] Network resources • All expected network resources are available. • No issues found! ```
littleGnAl commented 1 week ago

Thanks for your report, we will fix it in the next release.