简体   繁体   English

当我使用 react-native-geolocation-service 时,为什么 android 会寻找 RNCGeolocation?

[英]Why is android looking for RNCGeolocation when I use react-native-geolocation-service?

Trying to get an android version of a react-native 0.61.2 app running...试图让一个 android 版本的 react-native 0.61.2 应用程序运行......

The app intends to use react-native-geolocation-service but can not get past this error:该应用程序打算使用react-native-geolocation-service但无法克服此错误:

"Error: @react-native-community/geolocation: NativeModule.RNCGeolocation is null." “错误:@react-native-community/geolocation:NativeModule.RNCGeolocation 为空。”

在此处输入图片说明

I understand that react-native-geolocation-service uses @react-native-community/geolocation on iOS but this is android.我知道react-native-geolocation-service在 iOS 上使用@react-native-community/geolocation但这是 android。 I have searched the entire project for the string RNCGeolocation and it's not there.我已经在整个项目中搜索了字符串 RNCGeolocation,但它不存在。 How can I get running with react-native-geolocation-service on android?如何在 android 上使用react-native-geolocation-service运行?

For anyone dealing with this, i've tried every solution out there and still didn't work.对于任何处理此问题的人,我已经尝试了所有解决方案,但仍然无效。 I found that Geolocation uses a native location api (ou native module), and sometimes the problem is that the api seems not to be "there".我发现 Geolocation 使用了本地位置 api(ou native 模块),有时问题是 api 似乎不在“那里”。 So I installed react-native-location, that seems to provide (some of the same?) functions of that native api and, after that, I installed and was able to use @react-native-community/geolocation.所以我安装了 react-native-location,它似乎提供了(一些相同的?)本机 api 的功能,之后,我安装并能够使用 @react-native-community/geolocation。

Hope it helps :)希望能帮助到你 :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM