Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
MaxDaten opened this issue Aug 16, 2016 · 47 comments

Comments

@MaxDaten
Copy link

MaxDaten commented Aug 16, 2016

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

@jonathanloske
Copy link

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.

@newelement
Copy link

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

@ihadeed
Copy link
Collaborator

ihadeed commented Aug 23, 2016

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" notifications@github.com
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
#438, or mute the thread
https://github.com/notifications/unsubscribe-auth/ANJ8dHc0DxUfl97bzTiVIb5OvkBWmafxks5qgcoVgaJpZM4JleJl
.

@newelement
Copy link

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>

@ihadeed
Copy link
Collaborator

ihadeed commented Aug 23, 2016

@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.

@newelement
Copy link

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

ionic-native 1.3.16

@ihadeed
Copy link
Collaborator

ihadeed commented Aug 23, 2016

@newelement Just fixed it in 2510c5f
I'll publish a release in a few minutes.

@ihadeed
Copy link
Collaborator

ihadeed commented Aug 23, 2016

@newelement done 🎉

@newelement
Copy link

Awesome! thanks a lot.

@newelement
Copy link

All works well.

@MaxDaten
Copy link
Author

@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.

@paatrick
Copy link

@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 .

@ihadeed
Copy link
Collaborator

ihadeed commented Aug 23, 2016

@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

@paatrick
Copy link

@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); }
);

@ihadeed
Copy link
Collaborator

ihadeed commented Aug 24, 2016

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

@paatrick
Copy link

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

@paatrick
Copy link

Sorry forgot to specify the versions,

platform android: 5.2.2
cordova: 6.3.1
cordova_calendar_plugin: 4.5.1

@ihadeed
Copy link
Collaborator

ihadeed commented Aug 24, 2016

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

@almothafar
Copy link

almothafar commented Oct 27, 2016

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

@edmundtfy
Copy link

edmundtfy commented Jan 12, 2017

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

@ihadeed
Copy link
Collaborator

ihadeed commented Jan 12, 2017

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

@edmundtfy
Copy link

edmundtfy commented Jan 13, 2017

@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().

@ihadeed ihadeed reopened this Jan 13, 2017
@ihadeed
Copy link
Collaborator

ihadeed commented Jan 13, 2017

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

@edmundtfy
Copy link

@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

@mcwienczek
Copy link

mcwienczek commented Feb 8, 2017

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.

@ihadeed
Copy link
Collaborator

ihadeed commented Feb 8, 2017

@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.

@mcwienczek
Copy link

mcwienczek commented Feb 8, 2017

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.

@gigi-budrio
Copy link

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

@brassier
Copy link

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.

@sifang
Copy link

sifang commented Apr 27, 2017

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!

@moatazsoli
Copy link

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!

@matheusdavidson
Copy link

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.

@ihteandr
Copy link

I have same problem with cordova-plugin-camera

@ihteandr
Copy link

It works on emulator but does not on ionic view

@tony8382
Copy link

tony8382 commented Jul 18, 2017

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

@ihadeed
Copy link
Collaborator

ihadeed commented Jul 19, 2017

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

@coolvasanth
Copy link

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

@big-r81
Copy link

big-r81 commented Jul 28, 2017

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

@YamanSehzade
Copy link

YamanSehzade commented Aug 3, 2017

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

@coolvasanth
Copy link

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.

@Riyaz0001
Copy link

it's work, thanks a lot@ihadeed

@diegotch10
Copy link

@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?

@t3ndai
Copy link

t3ndai commented Jan 15, 2018

Same problem out here! Camera module!

@mk1023
Copy link

mk1023 commented Jan 18, 2018

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

@tony8382
Copy link

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

@dhasilva
Copy link

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.

@krithikuntukad
Copy link

Thank you dhasilva

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests