Skip to content

localizeLabels crashes on iOS when SymbolLayer text-field expression contains null comparison #2423

Description

@Taharu

Environment

  • Xcode version: 16.4
  • iOS version: 26.4
  • Maps SDK Version: 11.24.0 via mapbox_maps_flutter 2.24.0

Observed behavior and steps to reproduce

On iOS, the app crashes when calling label localization via StyleManager.localizeLabels from mapbox_maps_flutter for a style that contains a SymbolLayer whose text-field expression includes a null comparison.

The same style does not crash on Android.

Problematic expression inside layout.text-field:

["!=", ["get", "hoge"], null]

Example error:

mapbox_maps_flutter/StyleController.swift:367: Fatal error: 'try!' expression unexpectedly raised an error: Swift.DecodingError.dataCorrupted(Swift.DecodingError.Context(codingPath: [RootCodingKeys(stringValue: "layout", intValue: nil), LayoutCodingKeys(stringValue: "text-field", intValue: nil)], debugDescription: "Failed to decode Value<String>", underlyingError: nil))

Expected behavior

The SDK should not crash when a valid Mapbox expression containing a null comparison is used inside a SymbolLayer text-field.

It should either handle the expression correctly during label localization or return a recoverable error instead of crashing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🪲Something is broken!

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions