簡體   English   中英

離子插件錯誤:運行使用本機地理圍欄 API 的應用程序時 plugin_not_installed

[英]Ionic plugin error: plugin_not_installed when running application that uses native geofence API

我正在創建一個使用地理圍欄本機 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 來測試地理圍欄插件。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM