Skip to content

[Bug]: iOS App crashes when MapView doesn't fill whole screen #2192

@bviebahn

Description

@bviebahn

Mapbox Implementation

Maplibre

Mapbox Version

default

Platform

iOS

@rnmapbox/maps version

10.0.0-beta.33

Standalone component to reproduce

import React from 'react';
import {View} from 'react-native';
import MapboxGL from '@rnmapbox/maps';

const App = () => {
  return (
    <View style={{flex: 1}}>
      {/* crashes */}
      {/* <MapboxGL.MapView style={{width: 100, height: 100}} /> */}

      {/* doesn't crash but looks weird */}
      <MapboxGL.MapView style={{flex: 1}} />
    </View>
  );
};

export default App;

Observed behavior and steps to reproduce

I created a fresh project that reproduces the issue: https://github.com/bviebahn/RNMapboxCrash.
I added @rnmapbox/maps, added the pre- and post install scripts to the Podfile as described in the installation instructions, and rendered a MapView.

When the MapView doesn't fill the whole screen the app immediately crashes immediately.

When the Map fills the whole screen, the app doesn't crash, but the map has some visual issues.
Simulator Screen Shot - iPhone 13 - 2022-09-07 at 13 21 14

Am I missing something?

Expected behavior

App doesn't crash and Map is displayed correctly.

Notes / preliminary analysis

Output of npx react-native info:
(Does this warning have anything to do with it?)

warn Package @rnmapbox/maps contains invalid configuration: "dependency.platforms.ios.project" is not allowed. Please verify it's properly linked using "react-native config" command and contact the package maintainers about this.
info Fetching system and libraries information...
System:
    OS: macOS 12.5.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 116.28 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.17.0 - ~/.nvm/versions/node/v16.17.0/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v16.17.0/bin/yarn
    npm: 8.15.0 - ~/.nvm/versions/node/v16.17.0/bin/npm
    Watchman: Not Found
  Managers:
    CocoaPods: 1.11.3 - /opt/homebrew/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
    Android SDK: Not Found
  IDEs:
    Android Studio: 2021.2 AI-212.5712.43.2112.8815526
    Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.16.1 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 18.1.0 => 18.1.0 
    react-native: 0.70.0 => 0.70.0 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Additional links and references

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions