React Native Expo app crashes silently in production when using GooglePlacesAutocomplete

445 views Asked by At

Here is how i wrote GooglePlacesAutocomplete, I need to find a way to access the error logs so that i get to the root cause in production. I installed all react-native-maps dependencies with expo install so i have no incompatibility issues. I'm also wondering wether Marker is imported from expo or i need to install a different library for it because I'm using the Marker and I didn't find any mention of it in the Expo Docs. Can logRocket or Bugsnug give me the error logs? Where else can i get the error logs for production apps by default ~ Google Play Console?

<GooglePlacesAutocomplete
                placeholder="Where are we delivering to?..."
                minLength={2}
                autoFocus={false}
                returnKeyType={"search"}
                onPress={(data, details = null) => {
                  handleChange("address")({
                    target: {
                      name: "address",
                      value: data.description,
                    },
                  });
                  dispatch(
                    setOrigin({
                      latLng: details.geometry.location,
                      description: data.description,
                    })
                  );
                  dispatch(setDestination(null));
                }}
                fetchDetails={true}
                query={{
                  key: GOOGLE_MAPS_API_KEY,
                  language: "en",
                  components: "country:ug",
                }}
                nearbyPlacesAPI="GooglePlacesSearch"
                enablePoweredByContainer={false}
                debounce={100}
                renderLeftButton={() => (
                  <MaterialCommunityIcons
                    name="map-marker"
                    size={30}
                    color={colors.deepRed}
                    style={{
                      zIndex: 14,
                      position: "absolute",
                      // top: 10,
                      // left: 0,
                    }}
                  />
                )}
              
                styles={{
                  textInputContainer: {
                    width: "100%",
                    // height: 50,
                    borderTopWidth: 0,
                    borderBottomWidth: 0,
                    borderRadius: 10,
                    margin: 0,
                    // paddingLeft: 30,
                    backgroundColor: "#667",
                  },
                  textInput: {
                    height: 50,
                    color: "#0D0D0D",
                    fontSize: 16,
                    // backgroundColor: "#E8E8E8",
                    paddingLeft: 30,
                    backgroundColor: "#6e67",
                  },
                 
                }}
                // Show error address is empty onBlur
                onFail={(error) => console.error(error)}
              >
                {errors.address && (
                  <View style={{ zIndex: 16 }}>
                    <Text
                      style={{
                        fontSize: 14,
                        color: colors.magenta,
                        fontStyle: "italic",
                      }}
                    >
                      {errors.address}*
                    </Text>
                  </View>
                )}
              </GooglePlacesAutocomplete>
    ```
Everything works fine in development. But when the app is published in Google playstore, getting to the screen that has this component just crashes and exits the app immediately. At first, thought it had something to do with the way i was storing the API key in the .env file but even applying it directly didn't help.

 
0

There are 0 answers