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

问题描述 投票:1回答:1

正在尝试运行本地版本的1.21.2应用的Android版本...

该应用打算使用react-native-geolocation-service,但无法克服此错误:

“错误:@ react-native-community /地理位置:NativeModule.RNCGeolocation为空。”

enter image description here

[我了解react-native-geolocation-service在iOS上使用@react-native-community/geolocation,但这是android。我已经在整个项目中搜索了字符串RNCGeolocation,但它不存在。如何在Android上使用react-native-geolocation-service运行?

android react-native geolocation
1个回答
0
投票

对于处理此问题的任何人,我都尝试过所有解决方案,但仍然无法正常工作。我发现Geolocation使用一个本地位置api(一个本地模块),有时问题是该api似乎不是“那里”。因此,我安装了react-native-location,它似乎提供了该本地api的功能(有些相同?),然后,我安装并能够使用@ react-native-community / geolocation。

希望有帮助:)

© www.soinside.com 2019 - 2024. All rights reserved.