BackgroundGeolocation plugin not installed

I’m trying to use the BackgroundGeolocation plugin by following the example code on http://ionicframework.com/docs/v2/native/backgroundgeolocation.

However, when calling the configure function I get the error below:

Native: tried calling BackgroundGeolocation.configure, but the BackgroundGeolocation plugin is not installed.

The plugin is indeed installed as per instructions (ionic plugin add cordova-plugin-mauron85-background-geolocation). I can see the plugin in the plugins folder, deleting and reinstalling it doesn’t help. So far I haven’t seen this behaviour (Ionic complaining that a plugin isn’t installed when it actually is installed) and am a bit lost about fixing it. Please help.

Edit: This error occurs when running on an Android device.

1 Like

Are you checking it in the browser?

Im having same problem … is someone having it working on ionic 2 beta10?

I’ve got the same issue as well.

i have been having this problem for the past 2 weeks. I dont know what the cause is, in case anyone gets as a solution before i do, please do share.

Thanks

Hi,
I get the same error…
Did you fix it ?

Same issue with cordova camera plugin. (Ionic 2 beta 10)

There seems to be a few posts in relation to other plugins reporting the same issue. Are the Ionic team able to look into this?

I don’t remember where I’ve seen this, but it was some configuration error/typo in background-geolocation.js.

Something like:


pluginRef: ‘plugin.backgroundGeoLocation’ => should be pluginRef: ‘plugin.backgroundGeolocation’

Try to use the latest ionic-native:

package.json:

{
“ionic-native”: “1.3.8”,
}

Cheers

@devnullrandom, so I should basically change ionic-native in package.json to

{
“ionic-native”: “1.3.8”,
}

and then run npm install command in terminal right?

@devnullrandom, Thanks a lot for your response, background geolocation now works like a charm. Cheers.

hey, can I get some more information? I changed the package.json ionic-native to 1.3.8 (which is not even a version thats been created yet) and did an npm install, no success

Please check that you are doing the right thing. Can you post a copy of your package.json so I can see and verify. ionic-native is now beyond 1.3.10 version. Please check your info very well. If you create a new ionic 2 project with updated dependencies as of today, ionic-native shows this “version”: “1.3.21” as the most recent version.

{
  "dependencies": {
"@angular/common": "2.0.0-rc.4",
"@angular/compiler": "2.0.0-rc.4",
"@angular/core": "2.0.0-rc.4",
"@angular/forms": "0.2.0",
"@angular/http": "2.0.0-rc.4",
"@angular/platform-browser": "2.0.0-rc.4",
"@angular/platform-browser-dynamic": "2.0.0-rc.4",
"angular2-moment": "^0.8.2",
"angularfire2": "2.0.0-beta.2",
"es6-shim": "^0.35.0",
"firebase": "^3.2.1",
"geofire": "^4.1.1",
"ionic-angular": "2.0.0-beta.11",
"ionic-native": "1.3.8",
"ionic-process-spinner": "0.0.1",
"ionicons": "3.0.0",
"lodash": "^4.13.1",
"moment": "^2.15.0",
"ng2-translate": "2.2.2",
"reflect-metadata": "^0.1.3",
"rxjs": "5.0.0-beta.6",
"zone.js": "^0.6.12"
  },
  "devDependencies": {
"del": "2.2.0",
"gulp": "3.9.1",
"gulp-fontgen": "^0.2.4",
"gulp-watch": "4.3.5",
"ionic-gulp-browserify-typescript": "2.0.0",
"ionic-gulp-fonts-copy": "^1.0.0",
"ionic-gulp-html-copy": "^1.0.0",
"ionic-gulp-sass-build": "^1.0.0",
"ionic-gulp-scripts-copy": "^2.0.0",
"ionic-gulp-tslint": "^1.0.0",
"run-sequence": "1.1.5",
"tslint-ionic-rules": "^0.0.3"
  },
  "cordovaPlugins": [
"cordova-plugin-device",
"cordova-plugin-console",
"cordova-plugin-whitelist",
"cordova-plugin-splashscreen",
"cordova-plugin-statusbar",
"ionic-plugin-keyboard",
"cordova-plugin-calendar",
"cordova-plugin-mauron85-background-geolocation",
{
  "locator": "https://github.com/phonegap-googlemaps-plugin/cordova-plugin-googlemaps",
  "id": "cordova-plugin-googlemaps"
},
{
  "locator": "https://bitbucket.org/nightstomp/cordova-plugin-googlemaps-sdk.git",
  "id": "com.googlemaps.ios"
}
  ],
  "cordovaPlatforms": [
{
  "platform": "ios",
  "version": "",
  "locator": "ios"
},
{
  "platform": "android",
  "version": "",
  "locator": "android"
}
  ],
  "name": "helloworld",
  "description": "helloworld"
}

Then you may proceed with this or use more recent versions. What you need to do next is do an npm install from the terminal in your project root directory.

There is no “ionic-native” in my package.json

"dependencies": {
    "@angular/animations": "7.0.1",
    "@angular/common": "7.0.1",
    "@angular/compiler": "7.0.1",
    "@angular/compiler-cli": "7.0.1",
    "@angular/core": "7.0.1",
    "@angular/forms": "7.0.1",
    "@angular/http": "7.0.1",
    "@angular/platform-browser": "7.0.1",
    "@angular/platform-browser-dynamic": "7.0.1",
    "@angular/platform-server": "7.0.1",
    "@angular/router": "7.0.1",
    "@ionic-native/android-permissions": "4.20.0",
    "@ionic-native/background-geolocation": "4.20.0",
    "@ionic-native/barcode-scanner": "4.20.0",
    "@ionic-native/camera": "4.20.0",
    "@ionic-native/contacts": "4.20.0",
    "@ionic-native/core": "4.20.0",
    "@ionic-native/device": "4.20.0",
    "@ionic-native/email-composer": "4.20.0",
    "@ionic-native/facebook": "4.20.0",
    "@ionic-native/file": "4.20.0",
    "@ionic-native/geolocation": "4.20.0",
    "@ionic-native/globalization": "4.20.0",
    "@ionic-native/google-maps": "4.15.1",
    "@ionic-native/google-plus": "4.16.0",
    "@ionic-native/keyboard": "4.16.0",
    "@ionic-native/linkedin": "^4.16.0",
    "@ionic-native/media": "4.16.0",
    "@ionic-native/native-audio": "4.16.0",
    "@ionic-native/native-geocoder": "4.16.0",
    "@ionic-native/native-page-transitions": "4.16.0",
    "@ionic-native/network": "4.16.0",
    "@ionic-native/push": "4.16.0",
    "@ionic-native/social-sharing": "4.16.0",
    "@ionic-native/splash-screen": "4.16.0",
    "@ionic-native/sqlite": "4.16.0",
    "@ionic-native/status-bar": "4.16.0",
    "@ionic-native/streaming-media": "4.16.0",
    "@ionic-native/twitter-connect": "4.16.0",
    "@ionic/storage": "2.2.0",
    "@ngrx/effects": "^6.1.2",
    "@ngrx/router-store": "^6.1.2",
    "@ngrx/store": "^6.1.2",
    "@ngx-translate/core": "^11.0.1",
    "@ngx-translate/http-loader": "^4.0.0",
    "@techiediaries/ngx-qrcode": "0.0.5",
    "android-versions": "^1.3.0",
    "angular-progress-bar": "^1.0.9",
    "angular2-text-mask": "^9.0.0",
    "angularfire2": "^4.0.0-rc0",
    "com.googlemaps.ios": "https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk",
    "com.telerik.plugins.nativepagetransitions": "^0.6.5",
    "cordova-android": "^7.1.4",
    "cordova-android-support-gradle-release": "^2.0.1",
    "cordova-browser": "^5.0.4",
    "cordova-ios": "^4.5.5",
    "cordova-plugin-add-swift-support": "^1.7.1",
    "cordova-plugin-android-permissions": "^1.0.0",
    "cordova-plugin-camera": "^4.0.3",
    "cordova-plugin-compat": "^1.2.0",
    "cordova-plugin-console": "^1.1.0",
    "cordova-plugin-contacts": "^3.0.1",
    "cordova-plugin-device": "^2.0.2",
    "cordova-plugin-email-composer": "^0.8.15",
    "cordova-plugin-facebook4": "^3.2.0",
    "cordova-plugin-file": "^6.0.1",
    "cordova-plugin-geolocation": "^4.0.1",
    "cordova-plugin-globalization": "^1.11.0",
    "cordova-plugin-googlemaps-sdk": "git+https://github.com/mapsplugin/cordova-plugin-googlemaps-sdk.git",
    "cordova-plugin-googleplus": "^5.3.2",
    "cordova-plugin-ionic-keyboard": "^2.1.3",
    "cordova-plugin-ionic-webview": "^2.2.5",
    "cordova-plugin-linkedin": "^1.2.1",
    "cordova-plugin-mauron85-background-geolocation": "^2.3.6",
    "cordova-plugin-media": "^5.0.2",
    "cordova-plugin-nativeaudio": "^3.0.9",
    "cordova-plugin-nativegeocoder": "^3.1.3",
    "cordova-plugin-network-information": "^2.0.1",
    "cordova-plugin-splashscreen": "^5.0.2",
    "cordova-plugin-statusbar": "^2.4.2",
    "cordova-plugin-streaming-media": "^2.2.0",
    "cordova-plugin-swift-support": "^3.1.1",
    "cordova-plugin-whitelist": "^1.3.3",
    "cordova-plugin-x-socialsharing": "^5.4.3",
    "cordova-sqlite-storage": "^2.5.2",
    "es6-promise-plugin": "^4.2.2",
    "firebase": "^3.9.0",
    "font-awesome": "^4.7.0",
    "ionic-angular": "3.9.2",
    "ionic-plugin-keyboard": "^2.2.1",
    "ionic-tooltips": "^2.1.1",
    "ionicons": "4.4.6",
    "phonegap-plugin-barcodescanner": "^8.0.1",
    "phonegap-plugin-push": "^2.2.3",
    "promise-polyfill": "^8.1.0",
    "run": "^1.4.0",
    "rxjs": "^6.3.3",
    "rxjs-compat": "^6.3.3",
    "sw-toolbox": "3.6.0",
    "twitter-connect-plugin": "git+https://github.com/chroa/twitter-connect-plugin.git",
    "web-animations-js": "^2.3.1",
    "zone.js": "0.8.26"
  },