Skip to content

[Bug]: Unexpectedly found nil while implicitly unwrapping an Optional value #4185

@w8ight

Description

@w8ight

Mapbox Version

default

React Native Version

0.84.1

Platform

iOS

@rnmapbox/maps version

10.3.0

Standalone component to reproduce

import React from 'react';
import {
  Images,
  MapView,
  ShapeSource,
  LineLayer,
  Camera,
} from '@rnmapbox/maps';
import anyPngIcon from './any-png-icon.png';

const aLine = {
  type: 'LineString',
  coordinates: [
    [-74.00597, 40.71427],
    [-74.00697, 40.71527],
  ],
};

class BugReportExample extends React.Component {
  render() {
    return (
      <MapView style={{flex: 1}}>
        <Images images={{icon: anyPngIcon}} />
        <Camera centerCoordinate={[-74.00597, 40.71427]} zoomLevel={14} />

        <ShapeSource id="idStreetLayer" shape={aLine}>
          <LineLayer id="idStreetLayer" />
        </ShapeSource>
      </MapView>
    );
  }
}

Observed behavior and steps to reproduce

After upgrading to RN 0.84.1, app on iOS started crashing immediately due to usage of the component with a native error saying Unexpectedly found nil while implicitly unwrapping an Optional value

Tried using both images/nativeAssetImages

Happens in both debug and release modes

Xcode 26.4, but happened on 26.3 version as well

Expected behavior

App should not crash

Notes / preliminary analysis

No response

Additional links and references

Image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions