reactjs - 我在使用 react-native-geolocation-service 时得到 [TypeError: null is not an object (evalating 'RNFusedLocation.getCurrentPosition')]
问题描述
尝试使用 react-native-geolocation-service 并按照提供的设置进行操作,但仍然出现错误。我在用着:
- 反应原生”:“0.63.4,
- react-native-geolocation-service": "^5.2.0
import Geolocation from 'react-native-geolocation-service';
Geolocation.getCurrentPosition(
(position) => {
console.log(position);
},
(error) => {
console.log(error.code, error.message);
},
{enableHighAccuracy: false, timeout: 10000, maximumAge: 100000},
);
解决方案
我认为这是我的错,我通过重建修复了它
cd android
./gradlew clean
./gradlew cleanBuildCache
cd ../
感谢您的回答
推荐阅读
- python - 使用 conda 进行全新 ubuntu 20.04 安装的 Segfault
- r - 使用 coord_polar 更改 Y 比例
- php - 在 profile.php 中显示登录用户的数据
- python - rpy2 pass : 在函数参数中
- dolphindb - 如何在 DolphinDB 中使用 cutPoints?
- amazon-web-services - 在每次应用时销毁和创建 Ec2 实例
- c++ - 如何在不使用“if”的情况下编写返回值取决于标志的函数?
- r - 使用 lubridate - R 解析日期
- node.js - 如何检查文档是否存在于 MongoDB 中
- python - 如何查找 numpy 数组的索引并在列表中打印相应的行