devfd / react-native-geocoder

geocoding services for react native
MIT License
430 stars 179 forks source link

undefined is not an object (evaluating 'RNGeocoder.geocodePosition') #63

Open joaoalbertocsjunior opened 6 years ago

joaoalbertocsjunior commented 6 years ago

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 6 years ago

@joaoalbertocsjunior Did you forget to add libRNGeocoder.a file to build phases?

ameshkin commented 6 years ago

I did add the library and I'm still getting this error.

alexandrius commented 5 years ago

just use react-native link react-native-geocoder and pod update

gouravrc commented 4 years ago

@joaoalbertocsjunior try to put libRNGeocoder.a in Target > Build phase > Link Libraries