Skip to content

firebase_ai: Map<String, List<String>> cast error #17702

@orkun1675

Description

@orkun1675

Is there an existing issue for this?

  • I have searched the existing issues.

Which plugins are affected?

Other

Which platforms are affected?

Android, iOS

Description

When listening to the LiveSession.receive() Stream we are intermittently seeing errors that look like the following:

'_Map<String, dynamic>' is not a subtype of type 'Map<String, List<String>>' in type cast

Using firebase_ai 3.2.0 on Android with the Google Developer API.

Reproducing the issue

No known consistent reproduction steps at this time.

Firebase Core version

4.1.0

Flutter Version

3.32.8

Relevant Log Output

I/flutter (26162): The following exception was thrown type '_Map<String, dynamic>' is not a subtype of type 'Map<String, List<String>>' in type cast:
I/flutter (26162): #0      _parseServerMessage (package:firebase_ai/src/live_api.dart:326:38)
live_api.dart:326
I/flutter (26162): #1      parseServerResponse (package:firebase_ai/src/live_api.dart:288:31)
live_api.dart:288
I/flutter (26162): #2      new LiveSession.<anonymous closure> (package:firebase_ai/src/live_session.dart:36:34)
live_session.dart:36
I/flutter (26162): #6      _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:798:19)
stream_controller.dart:798
I/flutter (26162): #7      _StreamController._add (dart:async/stream_controller.dart:663:7)
stream_controller.dart:663
I/flutter (26162): #8      _StreamController.add (dart:async/stream_controller.dart:618:5)
stream_controller.dart:618
I/flutter (26162): #12     _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:798:19)
stream_controller.dart:798
I/flutter (26162): #13     _StreamController._add (dart:async/stream_controller.dart:663:7)
stream_controller.dart:663
I/flutter (26162): #14     _StreamController.add (dart:async/stream_controller.dart:618:5)
stream_controller.dart:618
I/flutter (26162): #15     _StreamSinkWrapper.add (dart:async/stream_controller.dart:898:13)
stream_controller.dart:898
I/flutter (26162): #16     _GuaranteeSink.add (package:stream_channel/src/guarantee_channel.dart:125:12)
guarantee_channel.dart:125
I/flutter (26162): #17     new AdapterWebSocketChannel.<anonymous closure>.<anonymous closure> (package:web_socket_channel/adapter_web_socket_channel.dart:87:36)
adapter_web_socket_channel.dart:87
I/flutter (26162): #23

Flutter dependencies

Expand Flutter dependencies snippet
Replace this line with the contents of your `flutter pub deps -- --style=compact`.

Additional context and comments

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs AttentionThis issue needs maintainer attention.platform: androidIssues / PRs which are specifically for Android.platform: iosIssues / PRs which are specifically for iOS.plugin: ailabel issues for firebase_ai plugintype: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions