react-native-maps: App crash on ios 15.4
Bug report
Summary
App started to crash with ios 15.4
Environment info
react-native: 0.66.4 react: 17.0.2 react-native-maps: 0.30.1
Target Platform: iOS - 15.4 Simulator/iPhone 13 Using GoogleMaps
react-native info output:
System: OS: macOS 12.2.1 CPU: (8) arm64 Apple M1 Memory: 1.02 GB / 16.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 16.13.2 - ~/.nvm/versions/node/v16.13.2/bin/node Yarn: 1.22.17 - ~/.nvm/versions/node/v16.13.2/bin/yarn npm: 8.1.2 - ~/.nvm/versions/node/v16.13.2/bin/npm Watchman: 2022.01.24.00 - /usr/local/bin/watchman Managers: CocoaPods: 1.11.2 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: DriverKit 21.4, iOS 15.4, macOS 12.3, tvOS 15.4, watchOS 8.5 Android SDK: Not Found IDEs: Android Studio: 2020.3 AI-203.7717.56.2031.7678000 Xcode: 13.3/13E113 - /usr/bin/xcodebuild Languages: Java: 11.0.12 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 17.0.2 => 17.0.2 react-native: 0.66.4 => 0.66.4 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found
Steps to reproduce
- Create a component with:
import { StyleSheet } from 'react-native';
import MapView, { PROVIDER_GOOGLE } from 'react-native-maps';
<MapView
provider={PROVIDER_GOOGLE}
style={StyleSheet.absoluteFill}
/>
- Display the component
- After a few seconds, the app crashes
Describe what you expected to happen:
- The app don’t crash
Everything works fine when provider is not set.
Crash report: crash_report.txt
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 14
- Comments: 36 (3 by maintainers)
I was having this issue and i manage to solve it this way.
import MapView, {PROVIDER_GOOGLE, PROVIDER_DEFAULT} from 'react-native-maps';Then create an useState for the map provider and set its initial value to the default provider (PROVIDER_DEFAULT), then on the MapView component, use the onMapReady listener, inside of it change the state of the provider to the PROVIDER_GOOGLE and it should load without crashing after ✌️I have same issue solved it by giving static width and height like (width:500,height:500) or by giving height and width with Dimensions from react-native, use flex:1 also leads to app crash on iOS.
I am facing this issue in non-M1 mac. The error stack trace also looks similar. But the issue is only in Simulator not in real device. ios version = 15.4 react-native-maps = v30.1 Crash in Simulator, real device is working fine
Worked fine before with v0.27.1 but after updating to v30.1 the crashes started.I will update here, If I get any more info.
EDIT 1: This issue happens only in ios v15.4, ran the same application on v15.0 and v15.2, it worked properly. Once again the issue happens only in simulator, checked in real device running v15.4 it worked properly.
@salah-ghanim I respectfully disagree 😃
Yes the dependencies are somewhat regularly updated, but having an issue like this seems like a good reason to update the dependency sooner rather than later (or eventually) and this issue will serve as a reminder to do that (or to check the changelog/issue tracker of the SDK to determine if a fix was released). Quite a bit of people also only search within open issues before opening a new one, so this might also help prevent duplicate issues being created 😃
I get that it’s on Google to actually fix the underlying issue, but it’s on us to get the fix merged into react-native-maps, which makes it a relevant issue in this repo as well. Google also verified a very similar issue in the issue tracker case I linked above, which hopefully means that a fix is landing within the foreseeable future. So closing this is (imo) a bit rushed 😃
Let me hear your thoughts 😃
Also facing the same issue in the iOS 15.4 simulator. removing
provider={PROVIDER_GOOGLE}solves the issue. but i don’t like this temporary solution cause i want to use google maps viewI had the same issue. I found a solution online… Just add android:{ …, “config”: { “googleMaps”: { “apiKey”: <MAP API KEY> } } } and for IOS ios:{ …, “config”: { “googleMapsApiKey”: <MAP API KEY> } }
I solved setting a style to marker containing width or height as you prefer, such as:
version 0.31.1, iOS run ok,that works for me
I’m still seeing this issue.
React native version: 0.69.4 React native maps version: 1.2.0
The onMapReady solution does not work for me and neither does the width/height solution. Constant crashes unless I change the provider. Any update on this?
🎉 This issue has been resolved in version 1.1.0 🎉
The release is available on:
Your semantic-release bot 📦🚀
🎉 This issue has been resolved in version 1.1.0-beta.6 🎉
The release is available on:
Your semantic-release bot 📦🚀
@umarabdulhuq Thank you so much. It really works. ))