gpt4 book ai didi

android - 后台地理位置插件不适用于 Android 版本

转载 作者:行者123 更新时间:2023-11-29 01:04:25 26 4
gpt4 key购买 nike

我有一个安装了 BackgroundGeolocation 插件的 Ionic 应用程序。当我使用 ionic cordova run android 运行该应用程序时它运行良好,但是当我构建并在手机上手动安装它时,我在启动该应用程序时遇到此错误:

Native:尝试调用 BackgroundGeolocation.configure,但未安装 BackgroundGeolocation 插件

这是我的packaje.json 文件:

 {
"name": "cm-mobile",
"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": {
"@angular/common": "5.0.3",
"@angular/compiler": "5.0.3",
"@angular/compiler-cli": "5.0.3",
"@angular/core": "5.0.3",
"@angular/forms": "5.0.3",
"@angular/http": "5.0.3",
"@angular/platform-browser": "5.0.3",
"@angular/platform-browser-dynamic": "5.0.3",
"@ionic-native/background-geolocation": "^4.5.2",
"@ionic-native/background-mode": "^4.5.2",
"@ionic-native/barcode-scanner": "^4.5.2",
"@ionic-native/battery-status": "^4.5.2",
"@ionic-native/camera": "^4.5.2",
"@ionic-native/core": "^4.5.2",
"@ionic-native/file": "^4.5.2",
"@ionic-native/file-transfer": "^4.5.2",
"@ionic-native/geolocation": "^4.5.2",
"@ionic-native/launch-navigator": "^4.5.2",
"@ionic-native/push": "^4.5.2",
"@ionic-native/splash-screen": "4.4.0",
"@ionic-native/status-bar": "^4.4.0",
"@ionic/storage": "2.1.3",
"@types/leaflet": "^1.2.5",
"cordova-android": "6.3.0",
"cordova-plugin-actionsheet": "^2.3.3",
"cordova-plugin-background-mode": "^0.7.2",
"cordova-plugin-battery-status": "^2.0.1",
"cordova-plugin-camera": "^4.0.1",
"cordova-plugin-device": "^1.1.4",
"cordova-plugin-dialogs": "^2.0.1",
"cordova-plugin-file": "^5.0.0",
"cordova-plugin-file-transfer": "^1.7.0",
"cordova-plugin-geolocation": "^4.0.1",
"cordova-plugin-ionic-webview": "^1.1.16",
"cordova-plugin-mauron85-background-geolocation": "^2.3.3",
"cordova-plugin-splashscreen": "^4.0.3",
"cordova-plugin-statusbar": "^2.4.1",
"cordova-plugin-whitelist": "^1.3.1",
"ionic-angular": "3.9.2",
"ionic-plugin-keyboard": "^2.2.1",
"ionicons": "3.0.0",
"leaflet": "^1.2.0",
"phonegap-plugin-barcodescanner": "^7.0.1",
"phonegap-plugin-push": "^2.1.2",
"rxjs": "5.5.2",
"sw-toolbox": "3.6.0",
"uk.co.workingedge.phonegap.plugin.launchnavigator": "^4.1.3",
"zone.js": "0.8.18"
},
"devDependencies": {
"@ionic/app-scripts": "3.1.6",
"typescript": "2.4.2"
},
"description": "An Ionic project",
"cordova": {
"plugins": {
"ionic-plugin-keyboard": {},
"cordova-plugin-whitelist": {},
"cordova-plugin-device": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-ionic-webview": {},
"cordova-plugin-mauron85-background-geolocation": {
"GOOGLE_PLAY_SERVICES_VERSION": "11.0.1",
"ICON": "@mipmap/icon",
"SMALL_ICON": "@mipmap/icon",
"ACCOUNT_NAME": "@string/app_name",
"ACCOUNT_LABEL": "@string/app_name",
"ACCOUNT_TYPE": "$PACKAGE_NAME.account",
"CONTENT_AUTHORITY": "$PACKAGE_NAME"
},
"phonegap-plugin-push": {
"FCM_VERSION": "11.0.1"
},
"cordova-plugin-file-transfer": {},
"cordova-plugin-file": {},
"cordova-plugin-geolocation": {},
"cordova-plugin-camera": {},
"cordova-plugin-background-mode": {},
"phonegap-plugin-barcodescanner": {},
"cordova-plugin-battery-status": {},
"uk.co.workingedge.phonegap.plugin.launchnavigator": {},
"cordova-plugin-statusbar": {},
"cordova-plugin-datecs-printer": {}
},
"platforms": [
"android"
]
}
}

是不是我做的不对,或者是 ionic-native 或插件的错误?

最佳答案

它发生在我身上是因为我没有从正确的地方调用函数(我是从服务而不是从 app.component.ts 调用它)。

guide状态:

BackgroundGeolocation must be called within app.ts and...

关于android - 后台地理位置插件不适用于 Android 版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48379727/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com