undefined is not an object (evaluating 'RNGeocoder.geocodePosition')
joaoalbertocsjunior opened this issue · 4 comments
joaoalbertocsjunior commented
Im getting this message, when trying to do reverse geocoding on rn using this package.
The code is as follows:
import Geocoder from 'react-native-geocoder';
locationPos = {
lat: positionToInsert.latitude,
lng: positionToInsert.longitude
}
Geocoder.geocodePosition(locationPos).then(res => {
this.setState({locPos: res[0].formattedAddress})
})
.catch(err => console.log(err))
henninghall commented
@joaoalbertocsjunior Did you forget to add libRNGeocoder.a file to build phases?
ameshkin commented
I did add the library and I'm still getting this error.
alexandrius commented
just use react-native link react-native-geocoder and pod update
gouravrc commented
@joaoalbertocsjunior try to put libRNGeocoder.a
in Target > Build phase > Link Libraries