包 com.getcapacitor.community.bglocation 不存在

问题描述

我刚刚安装了电容背景地理定位插件https://www.npmjs.com/package/capacitor-background-geolocation) 当我在主活动文件中导入包时,它显示错误“包 com.getcapacitor.community.bglocation 不存在”

Error image

我需要应用程序在后台分享用户的位置一小时(每 5 分钟更新一次位置) 有什么解决办法吗?

解决方法

您是否向 build.gradle 文件添加了适当的依赖项? 有时需要invalidate caches and restart the IDE或者...