Plugin not instaled - Diagnostic


#1

Hello! Im trying to use @ionic-native/diagnostic , specifically diagnostic.isLocationEnabled, when I try it from my android smartphone the promise returns me “plugin_not_installed”

In cordova plugin list i get:

cordova.plugins.diagnostic 3.7.2 "Diagnostic"

In config.xml I have

<plugin name = "cordova.plugins.diagnostic" spec = "^ 3.7.2" />

I tried to put it also inside

platform.ready (). then (...

But I keep getting the same error

In the constructor im doing

this.plt.ready().then( ()=> {
this.diagnostic.isLocationEnabled()
.then((state) => {
if(state){
this.locationState=true;
} else {
this.locationState=false;
}
}).catch(e => {this.presentAlert(JSON.stringify(e));this.locationState=false;});
});

presentAlert is for show the error in a alert

package.json

{
  "name": "compras",
  "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/core": "4.4.0",
    "@ionic-native/diagnostic": "^4.5.2",
    "@ionic-native/geolocation": "^4.5.2",
    "@ionic-native/splash-screen": "4.4.0",
    "@ionic-native/status-bar": "4.4.0",
    "@ionic/pro": "1.0.16",
    "@ionic/storage": "2.1.3",
    "cordova-android": "^6.3.0",
    "cordova-plugin-device": "^1.1.7",
    "cordova-plugin-geolocation": "^3.0.0",
    "cordova-plugin-ionic-webview": "^1.1.16",
    "cordova-plugin-splashscreen": "^4.1.0",
    "cordova-plugin-whitelist": "^1.3.3",
    "cordova.plugins.diagnostic": "^3.7.2",
    "diagnostic": "0.0.1",
    "ionic": "^3.19.0",
    "ionic-angular": "3.9.2",
    "ionic-native": "^2.9.0",
    "ionic-plugin-keyboard": "^2.2.1",
    "ionicons": "3.0.0",
    "rxjs": "5.5.2",
    "sw-toolbox": "3.6.0",
    "zone.js": "0.8.18"
  },
  "devDependencies": {
    "@ionic/app-scripts": "3.1.5",
    "typescript": "2.4.2"
  },
  "description": "An Ionic project",
  "cordova": {
    "plugins": {
      "cordova-plugin-geolocation": {
        "GEOLOCATION_USAGE_DESCRIPTION": "geoLocation"
      },
      "ionic-plugin-keyboard": {},
      "cordova-plugin-whitelist": {},
      "cordova-plugin-device": {},
      "cordova-plugin-splashscreen": {},
      "cordova-plugin-ionic-webview": {},
      "cordova.plugins.diagnostic": {}
    },
    "platforms": [
      "android"
    ]
  }
}