react-native-geolocation: NativeModule.RNCGeolocation is null - RN 0.61.1
Environment
System: OS: macOS Mojave 10.14.6 CPU: (12) x64 Intel® Core™ i7-8850H CPU @ 2.60GHz Memory: 387.96 MB / 32.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 10.15.3 - ~/.nvm/versions/node/v10.15.3/bin/node Yarn: 1.17.3 - /usr/local/bin/yarn npm: 6.4.1 - ~/.nvm/versions/node/v10.15.3/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman SDKs: iOS SDK: Platforms: iOS 12.4, macOS 10.14, tvOS 12.4, watchOS 5.3 Android SDK: API Levels: 23, 26, 27, 28 Build Tools: 27.0.3, 28.0.3 System Images: android-27 | Google Play Intel x86 Atom IDEs: Android Studio: 3.2 AI-181.5540.7.32.5056338 Xcode: 10.3/10G8 - /usr/bin/xcodebuild npmPackages: react: 16.9.0 => 16.9.0 react-native: 0.61.1 => 0.61.1 npmGlobalPackages: react-native-cli: 2.0.1
Platforms
Both
Versions
- Android:
- iOS:
- react-native-geolocation: 2.0.2
- react-native: 0.61.1
- react: 16.9.0
Description
When running app on RN 0.61.1, I encounter this error in the debug console Error: @react-native-community/geolocation: NativeModule.RNCGeolocation is null.
Reproducible Demo
Run project after yarn and pod install, open debug console
About this issue
- Original URL
- State: open
- Created 5 years ago
- Reactions: 6
- Comments: 18
Same issue here on android, react-native-geolocation: 2.0.2, react-native: 0.61.5.
Has anyone found a fix/workaround?
Make sure you have
pod 'react-native-geolocation', path: '../node_modules/@react-native-community/geolocation'
in your pod fileGetting the same error on 0.61 (android)
Hi @zyonnetworks !
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!
Thats all! Thanks!
For me building failed after I installed it with yarn, but removing it, cleaning everything, and then reinstalling with npm instead fixed it for me. Here are the steps I took:
problem solved, just downgrade the version “@react-native-community/geolocation”: “1.4.2”
I was having the same issue. But after stopping the packager, cleaning my build in Xcode, and then running
pod install
it worked finecd android gradlew clean
this solutions rocks!!, thanks!