react-native - NativeModule RNCGeolocation 为空

标签 react-native geolocation

我升级到 react native 60 和 Pods。现在恢复为时已晚。我得到错误

@react-native-community/geolocation NativeModule.RNCGeolocation is Null.



我已经链接了模块,卸载重新安装模块,卸载节点模块并重新安装,pod 安装,创建新项目等

最佳答案

我遇到过同样的问题。我实际上在使用另一个库,它依赖于 @react-native-community/gelocation ,即 react-native-geolocation-service .我实际上并没有遵循安装步骤。当我这样做时,它起作用了。我猜由于您正在升级并且已取消链接,因此您需要将其添加到 Podfile 中,因为它 可能不支持自动链接。
对于 RN 版本 > 0.60,来自 geolocation service docs ,

Update your 'Podfile' (Add the following to the Podfile)

`pod 'react-native-geolocation', path: '../node_modules/@react-native-community/geolocation'`

Then run pod install from ios directory

关于react-native - NativeModule RNCGeolocation 为空,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57781423/

相关文章:

ios - RN能通过苹果应用商店审核吗?

javascript - 当用户在 Meteor 中提交帖子时,我如何有效地存储用户的位置?

android - 通话或短信电话位置

node.js - react native 命令没有响应

reactjs - 毫无痛苦地脱离世博会

css - 不变违规 : Text strings must be rendered within a Text component

database - 如何将世界上所有国家/城市/州放入我的数据库?

php - 是否有可以在给定位置时生成 IP 的服务或程序

java - twitter4j 地理流媒体 新加坡及其他地区的纬度/经度

javascript - React Native + Fetch => TypeError : Cannot read property 'then' of undefined