Message saying plugin is not installed


#1

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


#2

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:


#3

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


#4

My friend… try on a real device, please.


#5

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


#6

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


#7

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


#8

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


#9

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


#10

What/s your ionic info and package.json?


#11

Can you test on a Android device?


#12

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”: {}


#13

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.


#14

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.


#15

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.


#16

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


#17

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

#18

npm cache clean --force


#19

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

Still same problem.


#20

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.