datadog_flutter v1.7.0: App crashes when extraInfo property in setUserInfo method is null. Based on the changelog, this problem should have been appeared since datadog_flutter v1.5.2 with BREAKING CHANGE all attribute maps have been updated from Map<String, dynamic> to Map<String, Object>. These Maps no longer support nullable values.
This is the error from the native layer:
datadog_flutter/SwiftDatadogFlutterPlugin.swift:327: Fatal error: 'try!' expression unexpectedly raised an error: Swift.DecodingError.valueNotFound(Swift.Dictionary<Swift.String, AnyCodable.AnyCodable>, Swift.DecodingError.Context(codingPath: [], debugDescription: "The given data did not contain a top-level value.", underlyingError: nil))
This error occurs when calling the setUserInfo method like this:
I think you should either specify the default value for extraInfo (e.g. empty object) or fix the bug in the native layer to expect a nullable value.
Flutter doctor command output:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.10.4, on macOS 12.0.1 21A559 darwin-arm, locale en-LT)
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 13.3)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2020.3)
[✓] VS Code (version 1.65.2)
[✓] Connected device (2 available)
[✓] HTTP Host Availability
datadog_flutter v1.7.0: App crashes when extraInfo property in setUserInfo method is null. Based on the changelog, this problem should have been appeared since datadog_flutter v1.5.2 with
BREAKING CHANGE all attribute maps have been updated from Map<String, dynamic> to Map<String, Object>. These Maps no longer support nullable values.
This is the error from the native layer:
This error occurs when calling the
setUserInfo
method like this:You can fix the problem by providing an empty object to
extraInfo
.I think you should either specify the default value for
extraInfo
(e.g. empty object) or fix the bug in the native layer to expect a nullable value.Flutter doctor command output:
Let me know if you need any more details.