我升级到 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/