Geocoder not working on iphone (expo react-native app)
Hi,
I am getting the following error when I try to use react-native-geocoder:
TypeError: TypeError: undefined is not an object (evaluating 'RNGeocoder.geocodeAddress')
This error is located at: in Customer (at CustomersScreen/index.js:35) in RCTScrollContentView (at ScrollView.js:852) in RCTScrollView (at ScrollView.js:977) in ScrollView (at CustomersScreen/index.js:32) in CustomerAdapter (created by Query) in Query (created by Apollo(CustomerAdapter)) in Apollo(CustomerAdapter) (at CustomersScreen/index.js:73) in RCTSafeAreaView (at SafeAreaView.ios.js:35) in SafeAreaView (at CustomersScreen/index.js:59) in CustomersScreen (created by SceneView) in SceneView (at StackViewLayout.js:795) in RCTView (at View.js:44) in AnimatedComponent (at StackViewCard.js:69) in RCTView (at View.js:44) in AnimatedComponent (at screens.native.js:59) in Screen (at StackViewCard.js:57) in Card (at createPointerEventsContainer.js:27) in Container (at StackViewLayout.js:860) in RCTView (at View.js:44) in ScreenContainer (at StackViewLayout.js:311) in RCTView (at View.js:44) in AnimatedComponent (at StackViewLayout.js:307) in Handler (at StackViewLayout.js:300) in StackViewLayout (at withOrientation.js:30) in withOrientation (at StackView.js:79) in RCTView (at View.js:44) in Transitioner (at StackView.js:22) in StackView (created by Navigator) in Navigator (at createKeyboardAwareNavigator.js:12) in KeyboardAwareNavigator (at createAppContainer.js:388) in NavigationContainer (at App.js:88) in RCTView (at View.js:44) in Rehydrate (created by Rehydrated) in Rehydrated (at App.js:87) in ApolloProvider (at App.js:86) in App (created by Wrapper) in Wrapper (at withExpoRoot.js:22) in RootErrorBoundary (at withExpoRoot.js:21) in ExpoRootComponent (at renderApplication.js:34) in RCTView (at View.js:44) in RCTView (at View.js:44) in AppContainer (at renderApplication.js:33)
This error is located at: in NavigationContainer (at App.js:88) in RCTView (at View.js:44) in Rehydrate (created by Rehydrated) in Rehydrated (at App.js:87) in ApolloProvider (at App.js:86) in App (created by Wrapper) in Wrapper (at withExpoRoot.js:22) in RootErrorBoundary (at withExpoRoot.js:21) in ExpoRootComponent (at renderApplication.js:34) in RCTView (at View.js:44) in RCTView (at View.js:44) in AppContainer (at renderApplication.js:33)
- node_modules/react-native-geocoder/js/geocoder.js:29:22 in geocodeAddress
- components/Customer.js:34:30 in mapAddress
- components/Customer.js:49:83 in render
- node_modules/react-native/Libraries/Renderer/oss/ReactNativeRenderer-dev.js:10563:21 in finishClassComponent
- node_modules/react-native/Libraries/Renderer/oss/ReactNativeRenderer-dev.js:14091:21 in performUnitOfWork
- node_modules/react-native/Libraries/Renderer/oss/ReactNativeRenderer-dev.js:14129:41 in workLoop
- node_modules/react-native/Libraries/Renderer/oss/ReactNativeRenderer-dev.js:14226:15 in renderRoot
- node_modules/react-native/Libraries/Renderer/oss/ReactNativeRenderer-dev.js:15193:17 in performWorkOnRoot
- node_modules/react-native/Libraries/Renderer/oss/ReactNativeRenderer-dev.js:15090:24 in performWork
- node_modules/react-native/Libraries/Renderer/oss/ReactNativeRenderer-dev.js:15047:14 in performSyncWork
- node_modules/react-native/Libraries/Renderer/oss/ReactNativeRenderer-dev.js:15315:21 in batchedUpdates$1
- node_modules/react-native/Libraries/Renderer/oss/ReactNativeRenderer-dev.js:2616:31 in batchedUpdates
- node_modules/react-native/Libraries/Renderer/oss/ReactNativeRenderer-dev.js:2711:17 in _receiveRootNodeIDEvent
- node_modules/react-native/Libraries/Renderer/oss/ReactNativeRenderer-dev.js:2787:28 in receiveTouches
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:349:47 in __callFunction
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:106:26 in
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:297:10 in __guard
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:105:17 in callFunctionReturnFlushedQueue
- [native code]:null in callFunctionReturnFlushedQueue
The code snippet I am using to test the geocoder is below:
mapAddress = (address) => { Geocoder.geocodeAddress(address).then(res => { console.log(res)} ).catch(err => {console.log(err)}) }
<View style={[{flex: 0.30, height: 35, marginVertical: 5, marginHorizontal: 4, alignItems: 'center', backgroundColor: '#1abc9c',borderRadius: 15}]}> <Button title="Map" color="white" onPress={() => this.mapAddress('New York')}/> </View>
Any help is really appreciated. I m using expo to develop this hybrid react-native app.
Is this module dead? No support?
Same problem didn't find any solution yet
Expo, as far as I know does not support native modules. You have to eject to make use of them.
See this for more information.
This reborn module could be the best solution