react-native-geocoder icon indicating copy to clipboard operation
react-native-geocoder copied to clipboard

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

Open joaoalbertocsjunior opened this issue 7 years ago • 4 comments

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))

joaoalbertocsjunior avatar Dec 03 '17 23:12 joaoalbertocsjunior

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

henninghall avatar Jan 05 '18 18:01 henninghall

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

ameshkin avatar Aug 28 '18 03:08 ameshkin

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

alexandrius avatar Jan 09 '19 17:01 alexandrius

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

gouravrc avatar May 03 '20 06:05 gouravrc