BackgroundGeolocation plugin not installed ionic V3

#1

Hello ,i’m facing a strange ERROR when i try to fire the backgroundGeolocation.configure it throws

app-scripts] plugin is not installed.
[app-scripts] [13:31:25] console.warn: Install the BackgroundGeolocation plugin: ‘ionic cordova plugin add
[app-scripts] cordova-plugin-mauron85-background-geolocation@alpha’
tried calling BackgroundGeolocation.start, but the BackgroundGeolocation plugin is not installed

even if the pluging is intalled :

ionic cordova plugins ls
cordova plugin ls
cordova-plugin-mauron85-background-geolocation 2.3.6 “CDVBackgroundGeolocation”

my code :

map: GoogleMap;
  config: BackgroundGeolocationConfig = {
    desiredAccuracy: 10,
    stationaryRadius: 20,
    distanceFilter: 30,
    debug: true, //  enable this hear sounds for background-geolocation life-cycle.
    stopOnTerminate: false, // enable this to clear background location settings when the app terminates
  };
  
  constructor(private backgroundGeolocation: BackgroundGeolocation) {
    this.backgroundGeolocation.configure(this.config)
      .then((location: BackgroundGeolocationResponse) => {

        console.log(location);

        this.backgroundGeolocation.finish();

      })
      .catch((error) => {
        console.error(error)
      })

  }

  startTrackingUser() {
    // start recording location
    this.backgroundGeolocation.start();
  }

P.S: in documentation backGroundGeolocation.configure(configure) returns an Observable but when i installed the plugin find out thet it returns a promise .i think the doc is not updated

my ionic info :

Ionic:

   ionic (Ionic CLI)  : 4.7.1 (C:\Users\ASUS\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework    : ionic-angular 3.9.2
   @ionic/app-scripts : 3.2.1

Cordova:

   cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
   Cordova Platforms     : android 7.1.4, ios 4.5.5
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.3.2, (and 6 other plugins)

System:

   NodeJS : v8.11.3 (C:\Program Files\nodejs\node.exe)
   npm    : 5.6.0
   OS     : Windows 10

in the appModule i imported

import { BackgroundGeolocation } from '@ionic-native/background-geolocation';

and injected in Providers array

#2

Same here.
Any resolution?

#3

Hi,
This is my solution link in this forum.If you want please use this link.May be it will work,try it.


Thank you.

#4

I am getting the same error and experiencing similar logs as shown by ‘ilfo’, the original topic creator. I am following the same steps as outlined by ‘ilfo’.

I am using ionic 4.

Can Ionic team comment on this. Ionic 4 is not in beta anymore. The plugins should be not be out of sync to this level.

My ionic info:

Ionic:                                                                                        
                                                                                              
   ionic (Ionic CLI)             : 4.10.3 (C:\Users\admin\AppData\Roaming\npm\node_modules\ion
c)                                                                                            
   Ionic Framework               : @ionic/angular 4.0.2                                       
   @angular-devkit/build-angular : 0.12.4                                                     
   @angular-devkit/schematics    : 7.2.4                                                      
   @angular/cli                  : 7.2.4                                                      
   @ionic/angular-toolkit        : 1.4.0                                                      
                                                                                              
Cordova:                                                                                      
                                                                                              
   cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)                                          
   Cordova Platforms     : android 7.1.4                                                      
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 3
1.2, (and 4 other plugins)                                                                    
                                                                                              
System:                                                                                       
                                                                                              
   Android SDK Tools : 26.1.1 (C:\Users\admin\AppData\Local\Android\Sdk)                      
   NodeJS            : v10.15.1 (C:\Program Files\nodejs\node.exe)                            
   npm               : 6.4.1                                                                  
   OS                : Windows 10                                                             
1 Like
#5

This plugin is not working with @ionic-native/background-geolocation

Any ideas on what’s next for this.

#6

I got the exact same problem, please could somebody look in to this.

Ionic:

   ionic (Ionic CLI)             : 4.10.2 (C:\Users\Mart\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework               : @ionic/angular 4.1.1
   @angular-devkit/build-angular : 0.13.6
   @angular-devkit/schematics    : 7.2.4
   @angular/cli                  : 7.3.6
   @ionic/angular-toolkit        : 1.4.1

Cordova:

   cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
   Cordova Platforms     : android 7.1.4
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 3.1.2, (and 4 other plugins)

System:

   Android SDK Tools : 26.1.1 (C:\Users\Mart\AppData\Local\Android\Sdk)
   NodeJS            : v10.15.1 (C:\Program Files\nodejs\node.exe)
   npm               : 6.4.1
   OS                : Windows 10

Plugin list:

cordova-plugin-device 2.0.2 "Device"
cordova-plugin-ionic-keyboard 2.1.3 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 3.1.2 "cordova-plugin-ionic-webview"
cordova-plugin-mauron85-background-geolocation 3.0.0-alpha.50 "CDVBackgroundGeolocation"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-statusbar 2.4.2 "StatusBar"
cordova-plugin-whitelist 1.3.3 "Whitelist"