react native maps crashes on Standalone version from Google Play

SDK Version:40.0.0
Platforms(Android/iOS/web/all):Android

Hello
I use react-native-maps in my project. My project was developed using Expo SDK 37 and it was working fine. I tried recently to run the “expo-upgrade” command to upgrade to Expo SDK 40. I fixed some errors that I found in development mode and then I executed the command: “expo build: android”, selected to generate Bundle instead of APK, and then I got my bundle file. I uploaded that bundle file to Google Play Console in Internal Test release mode. When I downloaded the Internal Test version from Google Play and went to the Map page, the app crashes and reload immediately and I’m being able to see the map Screen.
Video showing the problem: https://youtu.be/MqfYoOZcmio
Ps: It was working fine with Expo SDK 37 before upgrading to Expo SDK 40
My app.json:

…
"android": {
"package": "package.name",
"versionCode": 123,
"config":{
"googleMaps":{
"apiKey":"MY_KEY"
}
}
},
"packagerOpts": {
"config": "metro.config.js",
"sourceExts": ["js", "jsx", "svg"]
}

I tried even to create a new project on Google API Manager and a new key, pass the package name of the project and activate Google Maps SDK for android but it did not work. I passed Google's sign-in SHA-1 key from Google Play to the project and it did not solve the problem.


I tried to eject from expo and then i made a native configuration for my project and then it worked fine just as before

Upvotes: 2

Views: 994

Answers (1)

Alex
Alex

Reputation: 111

I had the same issue after upgrading to SDK 40, In my case the problem was in custom Marker. Also in another project on SDK 40 I didn't have this issue, but I was loading custom marker from uri like this icon={{uri: some_url}}

WRONG

<MapView.Marker
       title="Your Title"
       description="Your Description"
       icon={require('../Images/mapPin.png')}    <== PROBLEM
       draggable
       coordinate={{
                  latitude: coords.latitude,
                  longitude: coords.longitude,
       }}

 />

RIGHT

    <MapView.Marker
           title="Your Title"
           description="Your Description"           
           draggable
           coordinate={{
                      latitude: coords.latitude,
                      longitude: coords.longitude,
           }}
    
     >
     <Image source={require('../Images/mapPin.png')} style={{width:50, height:50}} />
   </MapView.Marker>

Upvotes: 2

Related Questions