react-native-geolocation
react-native-geolocation copied to clipboard
RNCGeolocation is null
Ask your Question
i am running with windows running latest version rn and expo to my iphone i have tried just adding to a working home page import Geolocation from '@react-native-community/geolocation'; I get error NativeModule.RNCGeolocation is null is null
Any update on this issue, Ive come across this problem today.
Happens to me as well. Reverted back to v1.4.2 at the moment, but i'm facing another issue on another lib that is quite related to this feat
Is anybody solved this issue?
I choose to go down another route, so I dont know if its been fixed
pod 'react-native-geolocation', path: '../node_modules/@react-native-community/geolocation'
This changes to Podfile solved it for me.
I'm having this same problem on Android
You should use Expo's native API instead: https://reactnativemaster.com/react-native-geolocation-example/
Getting same issue on Android. changing podfile path wont fix it.
updating to 2.0.2 and removing the below line from Podfile fixed the related issues (from android and ios both) pod 'react-native-geolocation', path: '../node_modules/@react-native-community/geolocation'
You should use Expo's native API instead: https://reactnativemaster.com/react-native-geolocation-example/
I ended up using Expo's native API, as I am using expo already. No trouble so far.
Hi @njlcll !
On Android device, i have just tried to use the 'react-native-geolocation-service' and it really worked for me!
yarn add react-native-geolocation-service
As the API format is really similar, I had just to change the import line. Please, check it out!
// import Geolocation from '@react-native-community/geolocation';
import Geolocation from 'react-native-geolocation-service';
Thats all! Thanks!
Hi i have solve this issue in expo project by using expo expo pakage manager if you use
expo install @react-native-community/geolocation
then your issue will solve because it auto link you library after installation.
Hi i have solve this issue in expo project by using expo expo pakage manager if you use
expo install @react-native-community/geolocation
then your issue will solve because it auto link you library after installation.
@as1265513 still getting the same error after following your solution.
@roger10cassares what about iOS? Does the react-native-geolocation-service apply to iOS as well?
Could it be a iOS permission issue?
below is all I could find about location permissions.
if you provide both NSLocationWhenInUseUsageDescription and NSLocationAlwaysAndWhenInUseUsageDescription, your application will only ask for "when in use" permission on iOS 10, whereas on iOS 11+ it will show a dialog to the user where he'll be able to pick whether he'd like to give your app permission to access location always or only when the app is in use,
Thanks
Hi @esadkrs, I am sorry, I cannot tell you about since have any iOS devices
Hi @njlcll !
On Android device, i have just tried to use the
'react-native-geolocation-service'and it really worked for me!
yarn add react-native-geolocation-serviceAs the API format is really similar, I had just to change the import line. Please, check it out!
// import Geolocation from '@react-native-community/geolocation'; import Geolocation from 'react-native-geolocation-service';Thats all! Thanks!
good call. Solved my problem.
I was having the same issue and tried out both react-native-geolocation and @react-native-community/geolocation. Each time I was either getting "RNCGeolocation is null" or "Native module cannot be null." I am also using Expo on iPhone.
What worked for me is scrapping both those libraries and just using expo-location. You import it as follows:
import * as Location from "expo-location";