Message saying plugin is not installed

I’ve installed the Diagnostic plugin, following the Ionic Native install instructions:

$ ionic cordova plugin add cordova.plugins.diagnostic
$ npm install --save @ionic-native/diagnostic

I’ve also added Diagostic to my app.module.ts file.

When running the app in browser and Ionic DevApp (using ionic serve) i get the message:

console.warn: Native: tried calling Diagnostic.isGpsLocationEnabled, but the Diagnostic plugin is not 
            installed. 
console.warn: Install the Diagnostic plugin: 'ionic cordova plugin add cordova.plugins.diagnostic' 

I thought this might be due to the fact that I’m not running it on an actual device or emulator, but i was wrong. Running it on an iPhone or iPhone emulator gives me the exact same message as above.

I’ve tried to reinstall the plugin several times, and also reinstall the iOS platform several times, with no luck. It keeps telling me that the plugin is not installed.

Has anyone seen this behavior before, and does any of you have a workaround for it?

Thanks in advance.
Lars

You can not use plugins in ionic serve instance, only run browser… BUT, these plugin do not supports browser, so, you need to test on device.

See supported platforms:

Like i said in my post, i get the same message when running it on a device. :wink:

1 Like

My friend… try on a real device, please.

That’s what i did, Daniel. I have tried it many times on a real device. Getting the same message.

Sorry… :slight_smile:
So, when you tried, did you run with the -c or -i options? If yes, try without these options.

I ran it directly on my device, from xcode, so no options used.

Hummm… try remove (uninstall) the plugin and install again. Seeing in forum, worked for me one time.

I already did that. Many times. Didn’t work.

What/s your ionic info and package.json?

Can you test on a Android device?

Ionic info:

cli packages: (/usr/local/lib/node_modules)

@ionic/cli-utils  : 1.19.2
ionic (Ionic CLI) : 3.20.0

global packages:

cordova (Cordova CLI) : 8.0.0 

local packages:

@ionic/app-scripts : 3.1.8
Cordova Platforms  : android 7.0.0 ios 4.5.4
Ionic Framework    : ionic-angular 3.9.2

System:

ios-deploy : 1.9.2 
Node       : v9.4.0
npm        : 5.6.0 
OS         : macOS High Sierra
Xcode      : Xcode 9.3 Build version 9E145 

Environment Variables:

ANDROID_HOME : not set

Misc:

backend : legacy

In package.json i guess these are the things that’s interesting:

under dependencies:
@ionic-native/diagnostic”: “^4.6.0”,
“cordova.plugins.diagnostic”: “^4.0.5”,

and under plugins:
“cordova.plugins.diagnostic”: {}

Not at this moment, no. I need this to work in iOS first and foremost. What happens on Android is not relevant to me at this point.

Do you need Node 9? If not, then don’t use it. It isn’t as stable for Ionic as the LTS. Downgrade to 8.whatever the LTS is right now.

More importantly: Cordova 8 seems like the potential source of the problem. In general, you don’t want to update to brand new versions. There are too many dependencies in Ionic projects, and it’s easy for a “minor” update to break your whole project. Stick to versions that have been debugged and are stable. I’d try to get it working with Cordova 6.3 or 6.4, and then if that works, to get it working with Cordova 7.latest.

1 Like

Thanks Aaron. I’ll check that tomorrow morning. Now my work day ends, so I’m off out into the sunshine :smiley:

I’ll let you know how it goes.

I understand.
I was just asking to test, if the problem was specific in platform generation or ionic cordova core.

Ok, so i tried a bit, changing to all sorts of versions here and there, still same message, saying plugin is not installed. I’ve uninstalled and installed plugin and platform several times.

Here is my current ionic info:

cli packages: (/usr/local/lib/node_modules)

@ionic/cli-utils  : 1.19.2
ionic (Ionic CLI) : 3.20.0

global packages:

cordova (Cordova CLI) : 6.4.0 

local packages:

@ionic/app-scripts : 3.1.8
Cordova Platforms  : android 7.0.0 ios 4.3.1
Ionic Framework    : ionic-angular 3.9.2

System:

ios-deploy : 1.9.2 
Node       : v8.11.1
npm        : 5.6.0 
OS         : macOS High Sierra
Xcode      : Xcode 9.3 Build version 9E145 

Environment Variables:

ANDROID_HOME : not set

Misc:

backend : legacy

npm cache clean --force

Just did that, and removed both plugin and ios platform, and added plugin and platform again.

Still same problem.

Well look. It’s very hard to diagnose this on a forum, it could be anything about your system. But if you haven’t physically put everything in the recycle bin, I’d recommend doing that. Your experience is not normal. Maybe someone else will have a good idea, but I’m out of suggestions, except to physically delete by hand and start over. Good luck.

Edit: complete reinstallation of Node etc, from nothing.