angular - 离子插件错误:运行使用本机地理围栏 API 的应用程序时 plugin_not_installed
问题描述
我正在创建一个使用地理围栏本机 api 的应用程序。当我尝试使用 ionicDevApp 测试设备时,出现以下错误。
plugin_not_installed
我的控制台将记录以下警告:
[15:04:03] console.warn: Native: tried calling Geofence.addOrUpdate, but the Geofence plugin is not installed.
[15:04:03] console.warn: Install the Geofence plugin: 'ionic cordova plugin add cordova-plugin-geofence'
[15:04:03] console.log: Geofence failed to add plugin_not_installed
但是我已经cordova-plugin-geofence
使用以下命令安装了ionic cordova plugin add cordova-plugin-geofence
我也在npm install --save @ionic-native/geofence
安装插件后运行,但我仍然遇到同样的错误。
这是我的package.json
文件片段,显示了项目中依赖项的版本。
{
"name": "geolocation",
"version": "0.0.1",
"author": "Ionic Framework",
"homepage": "http://ionicframework.com/",
"private": true,
"scripts": {
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"lint": "ionic-app-scripts lint",
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve"
},
"dependencies": {
"@agm/core": "^1.0.0-beta.3",
"@angular/animations": "5.2.11",
"@angular/common": "5.2.11",
"@angular/compiler": "5.2.11",
"@angular/compiler-cli": "5.2.11",
"@angular/core": "5.2.11",
"@angular/forms": "5.2.11",
"@angular/http": "5.2.11",
"@angular/platform-browser": "5.2.11",
"@angular/platform-browser-dynamic": "5.2.11",
"@ionic-native/core": "4.7.0",
"@ionic-native/geofence": "^4.7.0",
"@ionic-native/geolocation": "^4.7.0",
"@ionic-native/splash-screen": "4.7.0",
"@ionic-native/status-bar": "4.7.0",
"@ionic/storage": "2.1.3",
"@types/pusher-js": "^4.2.0",
"body-parser": "^1.18.3",
"cordova-android": "7.0.0",
"cordova-ios": "4.5.4",
"cordova-plugin-add-swift-support": "^1.6.0",
"cordova-plugin-compat": "^1.2.0",
"cordova-plugin-device": "^2.0.2",
"cordova-plugin-geofence": "^0.7.0",
"cordova-plugin-geolocation": "^4.0.1",
"cordova-plugin-ionic-keyboard": "^2.1.2",
"cordova-plugin-ionic-webview": "^1.2.1",
"cordova-plugin-splashscreen": "^5.0.2",
"cordova-plugin-whitelist": "^1.3.3",
"dotenv": "^6.0.0",
"es6-promise-plugin": "^4.2.2",
"express": "^4.16.3",
"ionic-angular": "3.9.2",
"ionicons": "3.0.0",
"pusher": "^2.0.0",
"pusher-js": "^4.2.2",
"rxjs": "5.5.11",
"sw-toolbox": "3.6.0",
"zone.js": "0.8.26"
},
"devDependencies": {
"@ionic/app-scripts": "3.1.10",
"typescript": "~2.6.2"
},
"description": "An Ionic project",
"cordova": {
"plugins": {
"cordova-plugin-geolocation": {
"GEOLOCATION_USAGE_DESCRIPTION": "To locate you"
},
"cordova-plugin-geofence": {},
"cordova-plugin-whitelist": {},
"cordova-plugin-device": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-ionic-webview": {},
"cordova-plugin-ionic-keyboard": {},
"cordova-plugin-add-swift-support": {}
},
"platforms": [
"android",
"ios"
]
}
}
解决方案
它看起来不像 cordova-plugin-geofence 是 IonicDevApp 当前支持的插件列表的一部分:
https://ionicframework.com/docs/pro/devapp/
您需要将应用程序打包成适当的二进制文件,然后将其安装在您的 Android 上,或者如果您是 iOS 用户,则使用 TestFlight 来测试地理围栏插件。
推荐阅读
- javascript - CSS:定时器暂停动画
- flutter - 由于新的 google play 存储权限隐私政策,如何不从 playstore 中删除
- reactjs - 删除用户帐户对话框 - 使用 React JS 的 firebase
- php - wordpress 自定义模板上的 SMTP 出现 500 内部服务器错误
- python - 具有多个测试用例的字符串的正则表达式
- business-objects - 尝试更改计算时 SAP Business Objects XI Voyager 保存的报告超时
- java - 如何从下面有节点的节点中创建回收站视图?
- node.js - 使用 aws-iot-device-sdk-js-v2 的 AWS Device Advisor MQTT 测试失败
- macos - 编译后的 Electron 应用保存第一个启动路径
- python - 拆分文本行并创建变量