Ionic-native: Ionic-native ‘plugin not installed’ but ‘ionic plugin add’ says already installed

Created on 16 Aug 2016  Â·  47Comments  Â·  Source: ionic-team/ionic-native

Hi,

I have an issue with ionic-native an ionic 1, already reported here:
https://forum.ionicframework.com/t/ionic-native-plugin-not-installed-but-ionic-plugin-add-says-already-installed/60328?u=briends

For completness:


Hi,

I recently switched from ngCordova to ionic-native. Mainly for camera, statusbar and network. When using the network plugin it says:

[Warning] Native: tried calling e.connection, but the e plugin is not installed. (ionic.native.min.js, line 4) [Warning] Install the e plugin: 'ionic plugin add cordova-plugin-network-information' (ionic.native.min.js, line 4)

or statusbar, it says:

[Warning] Native: tried calling e.isVisible, but the e plugin is not installed. (ionic.native.min.js, line 4) [Warning] Install the e plugin: 'ionic plugin add cordova-plugin-statusbar' (ionic.native.min.js, line 4)

The camera plugin works without a warning.

Running ionic plugin add cordova-plugin-statusbar or ionic plugin add cordova-plugin-network-information this is the output:

$ ionic plugin add cordova-plugin-network-information Updated the hooks directory to have execute permissions Plugin "cordova-plugin-network-information" already installed on android. Plugin "cordova-plugin-network-information" already installed on ios. Saving plugin to package.json file

It's worth to be noted, that I installed ionic-native via bower install ionic-native --save and not npm install ionic-native because the node_modules seems not to be deployed to the app and I could not link to ionic.native.min.js. And I'm still using ionic 1 but with typescript.

What could be the problem here?

$ ionic info
Your system information:

Cordova CLI: 6.2.0
Gulp version:  CLI version 3.9.1
Gulp local:   Local version 3.9.1
Ionic Framework Version: 1.3.1
Ionic CLI Version: 1.7.16
Ionic App Lib Version: 0.7.3
ios-deploy version: 1.8.6 
ios-sim version: 5.0.6 
OS: Mac OS X El Capitan
Node Version: v0.12.7
Xcode version: Xcode 7.3.1 Build version 7D1014 

An example project: https://github.com/Briends/ionic-with-ionic-native/tree/master

need to reproduce

Most helpful comment

For others, I was running into this when using a plugin prior to platform ready. You may need to put plugin use inside a platform ready check.

All 47 comments

Chiming in because I have the same problem. Also Ionic 1 (1.3.1) but without TypeScript.

Cordova CLI: 6.3.1                                                                           
Ionic CLI Version: 1.7.16                                                                    
Ionic App Lib Version: 0.7.3                                                                 
ios-deploy version: 1.8.6                                                                    
ios-sim version: 5.0.8                                                                       
OS: Mac OS X El Capitan                                                                      
Node Version: v6.3.1                                                                         
Xcode version: Xcode 7.3.1 Build version 7D1014                                              

When I insert a breakpoint right before the position where the call fails and make the call in the traditional way everything works.

I'm having the same issue with nativeaudio.

Cordova CLI: 6.3.1
Gulp version: CLI version 3.9.0
Gulp local: Local version 3.9.1
Ionic Framework Version: 2.0.0-beta.11
Ionic CLI Version: 2.0.0-beta.32
Ionic App Lib Version: 2.0.0-beta.18
ios-deploy version: 1.8.6
ios-sim version: 5.0.4
OS: Mac OS X El Capitan
Node Version: v4.4.2
Xcode version: Xcode 7.3.1 Build version 7D1014

Also see forum post: https://forum.ionicframework.com/t/native-audio-will-not-install/61226/6

In what sequence did you list the JavaScript files in your index.html?

The correct order is:

  • cordova.js
  • ionic native
  • your app's code

On Aug 16, 2016 10:32 AM, "Jan-Philip Loos" [email protected]
wrote:

Hi,

I have an issue with ionic-native an ionic 1, already reported here:
https://forum.ionicframework.com/t/ionic-native-plugin-not-
installed-but-ionic-plugin-add-says-already-installed/60328?u=briends

For completness:

Hi,

I recently switched from ngCordova to ionic-native. Mainly for camera,
statusbar and network. When using the network plugin it says:

[Warning] Native: tried calling e.connection, but the e plugin is not
installed. (ionic.native.min.js, line 4)
[Warning] Install the e plugin: 'ionic plugin add cordova-plugin-network-information'
(ionic.native.min.js, line 4)

or statusbar, it says:

[Warning] Native: tried calling e.isVisible, but the e plugin is not
installed. (ionic.native.min.js, line 4)
[Warning] Install the e plugin: 'ionic plugin add
cordova-plugin-statusbar' (ionic.native.min.js, line 4)

The camera plugin works without a warning.

Running ionic plugin add cordova-plugin-statusbar or ionic plugin add
cordova-plugin-network-information this is the output:

$ ionic plugin add cordova-plugin-network-information
Updated the hooks directory to have execute permissions
Plugin "cordova-plugin-network-information" already installed on android.
Plugin "cordova-plugin-network-information" already installed on ios.
Saving plugin to package.json file

It's worth to be noted, that I installed ionic-native via bower install
ionic-native --save and not npm install ionic-native because the
node_modules seems not to be deployed to the app and I could not link to
ionic.native.min.js. And I'm still using ionic 1 but with typescript.

What could be the problem here?

$ ionic info
Your system information:
Cordova CLI: 6.2.0
Gulp version: CLI version 3.9.1
Gulp local: Local version 3.9.1
Ionic Framework Version: 1.3.1
Ionic CLI Version: 1.7.16
Ionic App Lib Version: 0.7.3
ios-deploy version: 1.8.6
ios-sim version: 5.0.6
OS: Mac OS X El Capitan
Node Version: v0.12.7
Xcode version: Xcode 7.3.1 Build version 7D1014

An example project: https://github.com/Briends/
ionic-with-ionic-native/tree/master

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/driftyco/ionic-native/issues/438, or mute the thread
https://github.com/notifications/unsubscribe-auth/ANJ8dHc0DxUfl97bzTiVIb5OvkBWmafxks5qgcoVgaJpZM4JleJl
.

On Ionic 2:

  <!-- cordova.js required for cordova apps -->
  <script src="cordova.js"></script>
  <!-- Polyfill needed for platforms without Promise and Collection support -->
  <script src="build/js/es6-shim.min.js"></script>
  <!-- Zone.js and Reflect-metadata  -->
  <script src="build/js/Reflect.js"></script>
  <script src="build/js/zone.js"></script>
  <script src="js/snap.svg-min.js"></script>
  <script src="js/web-animations.min.js"></script>
  <!-- The bundle which is built from the app's source code -->
  <script src="build/js/app.bundle.js"></script>

@newelement that response was directed to OP

Do you only get this issue with the native audio plugin? I suggest you first ensure that you have the latest version by running npm i --save ionic-native@latest. The native audio plugin was introduced in v1.3.14.

Yes only the nativeaudio plugin. All others are working fine.

ionic-native 1.3.16

@newelement Just fixed it in https://github.com/driftyco/ionic-native/commit/2510c5fd4aacd5d4b088a947d29a8458ad8c8ff7
I'll publish a release in a few minutes.

@newelement done 🎉

Awesome! thanks a lot.

All works well.

@ihadeed

In what sequence did you list the JavaScript files in your index.html?

The correct order is:

  • cordova.js
  • ionic native
  • your app's code

Indeed there was the problem. I imported cordova.js at last. Maybe it's worth to note this in the documentation or warn during runtime? I close this issue and report it back into the forum.

Thanks for the help.

@ihadeed Hello good afternoon , I have the same problem , I installed some plugins like calendar , datepicker , clipboard.
Also installed npm i ionic -native --save @ latest over the same problem continues. You know tell me how do I resolve this problem. I use ionic2.36 . I await an answer from already thank you very much .

@paatrick I would need more information to help you out.

  • Version of Ionic Native
  • Running on device? what platform?
  • Stacktrace / Steps to reproduce / code samples

@ihadeed Good afternoon.
ionic Version: 2.0.0 - beta.37
I'm testing the ionic view.
The pugin is Calendar (cordova-plugin-calendar).
I am using the example of the ionic documentation

Example:

import {Calendar} from 'ionic-native';

Calendar.createCalendar('MyCalendar').then(
(msg) => { console.log(msg); },
(err) => { console.log(err); }
);

@paatrick The Ionic View app doesn't support plugins.

@ihadeed I visualized here http://docs.ionic.io/docs/view-usage , I tested the camera plugin , and it worked.

Sorry forgot to specify the versions,

platform android: 5.2.2
cordova: 6.3.1
cordova_calendar_plugin: 4.5.1

@paatrick Can you try testing with the command ionic run android .. or ionic run android --livereload

Hi, I got same issue on another plugins, Device and SplashScreen,

ionic.native.min.js:6 Native: tried calling e.hide, but the e plugin is not installed.t.pluginWarn @ ionic.native.min.js:6
ionic.native.min.js:6 Install the e plugin: 'ionic plugin add cordova-plugin-splashscreen'

Calling it like:

$timeout(function () {
    $cordovaSplashscreen.hide();
}, 200);

Instead of $cordovaSplashscreen.hide(); without $timeout

Solved issue !
But it was not exist on version 2.1.9, its after i got 2.2.4

Have the same issue here, after installing the Globalisation plugin. Shortly before that I npm install -g ionic, but that didn't break other plugins
[INFO:CONSOLE(2)] "Native: tried calling t.getPreferredLanguage, but the t plugin is not installed.", source: file:///android_asset/www/build/main.js (2)
Cordova is added as the first script before ion-app or polyfill or main.js

System Info
Cordova CLI: 6.4.0
Ionic Framework Version: 2.0.0-rc.4-201701101946
Ionic CLI Version: 2.1.18
Ionic App Lib Version: 2.1.9
Ionic App Scripts Version: 0.0.46
ios-deploy version: 1.9.0
ios-sim version: 5.0.9
OS: macOS Sierra
Node Version: v6.9.1
Xcode version: Xcode 8.2.1 Build version 8C1002

@edmundtfy please update to latest version of @ionic/app-scripts and ionic-native.

@ihadeed
I ran

npm install @ionic/app-scripts@latest --save
npm install ionic-native@latest --save

and then
ionic run android

and then

[14:01:39]  ionic-app-script task: "build" 
[14:01:39]  Error: /Users/edmund/LULIO/IWTK/IWTK-Front/src/app/main.ts was not found. The "main.dev.ts" and 
            "main.prod.ts" files have been deprecated. Please create a new file "main.ts" containing the content of 
            "main.dev.ts", and then delete the deprecated files. For more information, please see the default Ionic 
            project main.ts file here: https://github.com/driftyco/ionic2-app-base/tree/master/src/app/main.ts 
[14:01:39]  build dev started ... 

npm ERR! Darwin 16.3.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build"
npm ERR! node v6.9.1
npm ERR! npm  v4.0.5
npm ERR! code ELIFECYCLE
npm ERR! ionic-hello-world@ build: `ionic-app-scripts build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the ionic-hello-world@ build script 'ionic-app-scripts build'.

And I found out I need to

  • run in the root project folder npm install sw-toolbox --save --save-exact
  • and do as suggested in this link. Follow instructions to update ionic, change main.ts, package.json

And then build successfully with ionic build android, got this error prompted as an alert box on android

The connection to the server was unsuccessfully (file:///android_asset/www/index.html)

And Got this error

"Native: tried calling Globalization.getPreferredLanguage, but the Globalization plugin is not installed.", source: file:///android_asset/www/build/main.js (4713)
exec() call to Globalization.getPreferredLanguage blocked the main thread for 63ms. Plugin should use CordovaInterface.getThreadPool().

@edmundtfy are you using Crosswalk? if so, you need to apply some timeout after deviceready has fired.

@ihadeed
I added timeout by adding <preference name="loadUrlTimeoutValue" value="700000" /> to my config.xml file and it works, but it does load a long time.
And I never added Crosswalk by hand or by calling ionic plugin add crosswalk or similar commands...

Is there a way to work around that slow loading time (for now it loads maybe 20 seconds before dismissing the splash screen

Same problem here:
Ionic 2.0.0
runing

ionic serve

sometimes, not always causes all network traffic to be suppressed on browser with the same warning message. After browser refresh the warning does not dissapear but requests are successful again.

@VsMaX running ionic serve launches your app as a website in the browser. Any cordova platform related files are not included. To test any plugin you need to run on a device or a simulator.

Hmm anyway, it should either work or not. Now it's very random.

Using

ionic serve

it sometimes works and sometimes it just throws warnings onto the console.

There is another problem: this thing is throwing warnings while invoking Auth.signup method from Ionic Cloud package. Therefore, if this is expected behaviour, Ionic Cloud has serious problem because any application that uses it cannot make use of ionic serve in order to develop the application.

The same problem for Gyroscope plugin.
I installato all what i need today, so I have the latest version for all tools.
thanks

For others, I was running into this when using a plugin prior to platform ready. You may need to put plugin use inside a platform ready check.

I have the same issue with Native Flurry: https://ionicframework.com/docs/native/flurry-analytics/

All Flurry calls fail with message similar to this, on device (ionic run android):
"Native: tried calling FlurryAnalyticsPlugin.init, but the FlurryAnalyticsPlugin plugin is not installed."

All calls are wrapped with Platform.ready().

Here is my environment:
Cordova CLI: 6.5.0
Ionic Framework Version: 3.1.0
Ionic CLI Version: 2.1.18
Ionic App Lib Version: 2.1.9
Ionic App Scripts Version: 1.3.4
ios-deploy version: Not installed
ios-sim version: Not installed
OS: macOS Sierra
Node Version: v7.8.0
Xcode version: Xcode 8.1 Build version 8B62

And the plug-in is installed.
[ionic plugin list]
...
cordova-plugin-flurry-analytics 1.2.1 "Flurry Analytics"
...

Please help!

Same thing happening to me but with Native Stripe pluging
https://ionicframework.com/docs/native/stripe/

All calls are wrapped with Platform.ready()
ran both

$ ionic plugin add --save cordova-plugin-stripe
$ npm install --save @ionic-native/stripe

and still getting "plugin_not_installed" error.

Please help us with this!

Same happens with cordova-plugin-sim. It works when i build without prod, but when i run with --prod tag it says that the plugin is not installed. For some reason the plugin is not added in production mode.

I have same problem with cordova-plugin-camera

It works on emulator but does not on ionic view

I have the same problem in the plugin "Device Accounts"
When I using this plugin, it will return "plugin_not_installed"

global packages:

    @ionic/cli-utils : 1.5.0
    Cordova CLI      : 7.0.1
    Ionic CLI        : 3.5.0

local packages:

    @ionic/app-scripts              : 2.0.2
    @ionic/cli-plugin-cordova       : 1.4.1
    @ionic/cli-plugin-ionic-angular : 1.3.2
    Cordova Platforms               : android 6.2.3
    Ionic Framework                 : ionic-angular 3.5.3

System:

    Node       : v8.1.3
    OS         : Windows 8.1
    Xcode      : not installed
    ios-deploy : not installed
    ios-sim    : not installed
    npm        : 5.0.3

@tony8382 this issue is almost a year old... please open a new issue with more details about your problem.

Hi @tony8382,
Facing same issue with ionic badge plugin.
http://ionicframework.com/docs/api/components/badge/Badge/

@ihadeed
FYI: Facing the same issue with Corsova File Plugin "cordova-plugin-file" on a new ionic project...

I have the same problem in the plugin "Local Notifications"
try this => this.platform.ready().then(() => { .. your code ... }
My problem is solved..

In my case even the this.platform.ready().then had not worked. I followed this tutorial https://learnionic2.com/2017/04/03/setting-notification-badges-within-ionic-2/ where he has used keywords like async which helped me in solving the issue.

it's work, thanks a lot@ihadeed

@ihadeed I have the same problem with the camera plugin, my cell phone does not work, plugin is not installed, did you solve the problem?

Same problem out here! Camera module!

I had the same issues with building "--prod". I fixed after I put my codes inside platform.ready().then(). Hopes this can helps.

Thanks for all of your reply
After put my codes in .then()
It okay now!

Commenting here to help other people that find this thread in the future:

Calling the plugin before platform.ready() resolves results in this error, but if that does not solve your problem, it might be that you are doing that unintentionally.
I'm using the OneSignal plugin encapsulated in its own service, and this service calls the plugin's functions in its constructor function. To ensure it initializes as soon as possible, I injected my service into the App Component, which instantiated the service before the App Component's constructor, where I called await this.platform.ready(). Took me an hour to realize that, so I thought I'd share this possible pitfall.

Thank you dhasilva

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mateo666 picture mateo666  Â·  3Comments

kyleap picture kyleap  Â·  4Comments

lycwed picture lycwed  Â·  4Comments

FdezRomero picture FdezRomero  Â·  4Comments

hobbydevs picture hobbydevs  Â·  3Comments