Minimal Example Crashing
Steps to Trigger Behavior
- clone repo
- npm install
- cd ios && pod install
- cd ..
- npm run ios
Link to Minimal Reproducible Example
https://github.com/Craytor/maplibre-rn-test
Expected Behavior
A map should be displayed.
Actual Behavior
Without the inclusion of <MapLibreGL.Camera />, the app simply displays no content and the following logs are shown in the bundler:
LOG Mapbox [fault] The attribution is not in the visible area of the mapview. Please check your position and offset settings {"filePath": "-[MGLMapView layoutSubviews]", "level": "fault", "line": 1080, "message": "The attribution is not in the visible area of the mapview. Please check your position and offset settings"}
LOG Mapbox [fault] The compassView is not in the visible area of the mapview. Please check your position and offset settings {"filePath": "-[MGLMapView layoutSubviews]", "level": "fault", "line": 1084, "message": "The compassView is not in the visible area of the mapview. Please check your position and offset settings"}
With the inclusion of <MapLibreGL.Camera />, the app immediately crashes with the provided crash report attached below.
Version(s) affected
- Platform: iOS
- OS version: iOS 17.4
- Device type: iPhone SE 3rd gen / iPhone 15 Pro
- Emulator/ Simulator: yes
- Development OS: M3 Max / 14.1.1 (23B2082)
- maplibre-react-native: ^10.0.0-alpha.2
- MapLibre GL version: https://github.com/maplibre/maplibre-gl-native-distribution @ 5.13.0
- React Native Version: "0.74.1"
Additional context
Crash report: crashreport.txt
Not sure what is going on with that crash report, but I also had trouble with the "Getting Started" example for Android when I was first trying it out. No map tiles were loading for me with the MapLibre demo tiles URL in that example. The screen was blank. I got it working by switching to following the example from Stadia Maps (and signing up for a free trial API key from them for it): https://docs.stadiamaps.com/native-multiplatform/maplibre-react-native/
Same problem here. Affects only the simulator and not the actual device (works on iOS and Android devices, have not tried android simulator)
Version(s) affected
- Platform: iOS
- OS version: iOS 17.5
- Device type: iPhone 15 Pro
- Emulator/ Simulator: yes
- Development OS: M2 Pro / 14.4.1
- maplibre-react-native: 9.1.0
- React Native Version: "0.72.10"
Can you please try ^10.0.0-alpha.4 and report back if the problem persists? Thanks.
Ok, took me much longer than expected since I had to upgrade everything (react native, expo, etc) to the latest as well. But happy news, it doesn't crash on the simulator anymore!