Skip to content

Contexts.fromJson fails with type error with SentryFirebaseRemoteConfigIntegration enabled #3006

Description

@kurtmarcink

Platform

Flutter Mobile Android

Obfuscation

Disabled

Debug Info

Disabled

Doctor

$ flutter doctor -v
[✓] Flutter (Channel stable, 3.32.1, on macOS 15.5 24F74 darwin-arm64, locale en-US)
    [306ms]
    • Flutter version 3.32.1 on channel stable at /<REDACTED>/fvm/versions/3.32.1
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision b25305a883 (4 weeks ago), 2025-05-29 10:40:06 -0700
    • Engine revision 1425e5e9ec
    • Dart version 3.8.1
    • DevTools version 2.45.1

[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0-rc4)
    [900ms]
    • Android SDK at /<REDACTED>/Library/Android/sdk
    • Platform android-35, build-tools 35.0.0-rc4
    • Java binary at:
      /<REDACTED>/Library/Java/JavaVirtualMachines/jbr-17.0.14/Contents/Home/bin/java
      This JDK is specified in your Flutter configuration.
      To change the current JDK, run: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version OpenJDK Runtime Environment JBR-17.0.14+1-1367.22-nomod (build
      17.0.14+1-b1367.22)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 16.4) [619ms]
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 16F6
    • CocoaPods version 1.16.2

[✓] Chrome - develop for the web [67ms]
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2024.3) [67ms]
    • 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 21.0.6+-13368085-b895.109)

[✓] IntelliJ IDEA Ultimate Edition (version 2025.1.3) [66ms]
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin version 86.0.2
    • Dart plugin version 251.26927.39

[✓] VS Code (version 1.98.2) [9ms]
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

⢿^[[[✓] Connected device (1 available) [5.6s]
    • sdk gphone64 arm64 (mobile)      • emulator-5554             • android-arm64  •
      Android 16 (API 36) (emulator)

[✓] Network resources [175ms]
    • All expected network resources are available.

• No issues found!

Version

9.1.0

Steps to Reproduce

  1. Init SentryFlutter with SentryFirebaseRemoteConfigIntegration:
await SentryFlutter.init((options) {
    options
      ...
      ..addIntegration(
        SentryFirebaseRemoteConfigIntegration(
          firebaseRemoteConfig: FirebaseRemoteConfig.instance,
        ),
      );
    ...
  }, appRunner: appRunner);
  1. Run the Flutter app on an Android device

Expected Result

There are no console errors

Actual Result

Console error is produced:

type 'String' is not a subtype of type 'Map<dynamic, dynamic>'
         #0      new Contexts.fromJson (package:sentry/src/protocol/contexts.dart:74:54)
         #1      _LoadContextsIntegrationEventProcessor.apply (package:sentry_flutter/src/integrations/load_contexts_integration.dart:62:35)
         <asynchronous suspension>
         #2      runEventProcessors (package:sentry/src/event_processor/run_event_processors.dart:26:52)
         <asynchronous suspension>
         #3      SentryClient.captureTransaction (package:sentry/src/sentry_client.dart:405:27)
         <asynchronous suspension>
         #4      Hub.captureTransaction (package:sentry/src/hub.dart:595:22)
         <asynchronous suspension>
         #5      SentryTracer.finish (package:sentry/src/sentry_tracer.dart:160:7)
         <asynchronous suspension>

The value of data[SentryFeatureFlags.type]:

flags: data[SentryFeatureFlags.type] != null

is Instance of 'SentryFeatureFlags', but it should be a Map

Are you willing to submit a PR?

None

Metadata

Metadata

Assignees

Labels

Projects

Status
No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions