HTTP plugin is not installed

Error

I install native http using this tutorial.


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

And I get this erro.

[20:49:03] console.warn: Native: tried calling HTTP.get, but the HTTP plugin is not installed.
[20:49:03] console.warn: Install the HTTP plugin: ‘ionic plugin add cordova-plugin-http’

My Ionic Info

global packages:

@ionic/cli-utils : 1.4.0
Cordova CLI      : 7.0.1
Ionic CLI        : 3.4.0

local packages:

@ionic/app-scripts              : 1.3.7
@ionic/cli-plugin-cordova       : 1.4.0
@ionic/cli-plugin-ionic-angular : 1.3.1
Cordova Platforms               : ios 4.4.0
Ionic Framework                 : ionic-angular 3.4.0

System:

Node       : v7.8.0
OS         : macOS Sierra
Xcode      : Xcode 8.3.3 Build version 8E3004b
ios-deploy : 1.7.0
ios-sim    : 6.0.0
npm        : 4.2.0
1 Like
  • How are you testing?
  • What does ionic cordova plugin list return?
  • Is there a good reason why you are using the HTTP native plugin and not Angular’s http?

Im using ios emulator.

cordova-plugin-compat 1.1.0 "Compat"
cordova-plugin-console 1.0.5 "Console"
cordova-plugin-device 1.1.4 "Device"
cordova-plugin-file 4.3.3 "File"
cordova-plugin-http 1.2.0 "SSL Pinning"
cordova-plugin-splashscreen 4.0.3 "Splashscreen"
cordova-plugin-statusbar 2.2.2 "StatusBar"
cordova-plugin-whitelist 1.3.1 "Whitelist"
ionic-plugin-keyboard 2.2.1 “Keyboard”

HTTP is the first plugin a tried. There is a good reason to not using this plugin?

Angular’s Http is more friendly.

Exactly, if there is no good reason, look into this: https://angular.io/guide/http

I have the same issue, install and reinstall and only get this warn console.warn: Native: tried calling HTTP.get, but the HTTP plugin is not installed. :rage::rage::rage::rage:

As has been stated before, do you have a particular reason to use the native HTTP plugin rather than the Angular one?

Ionic native, Ionic 3

What I mean is that Angular’s HTTP fulfills at least 95% of use cases, and is far easier to use. So do you specifically have a use case that is in the last 5%?

2 Likes

If you have multiple simultaneous requests to the same server Chrome stalls the connections. Native HTTP calls can help there.

Have the same issue :frowning: . The question is not about using Angular’s http request or not.
There is an Ionic Native Plugin and it’s not working.

My Ionic info is:

cli packages:

@ionic/cli-utils  : 1.6.0 
ionic (Ionic CLI) : 3.6.0

global packages:

Cordova CLI : 7.0.1

local packages:

@ionic/app-scripts              : 1.3.12
@ionic/cli-plugin-cordova       : 1.4.0
@ionic/cli-plugin-ionic-angular : 1.3.1
Cordova Platforms               : android 6.2.3 browser 4.1.0 ios 4.4.0
Ionic Framework                 : ionic-angular 3.5.0

System:

Android SDK Tools : 25.2.5
Node              : v7.10.0
OS                : OS X El Capitan
Xcode             : Xcode 8.1 Build version 8B62
ios-deploy        : 1.9.0
ios-sim           : 5.0.13
npm               : 4.2.0
2 Likes

The Ionic Native HTTP changed the cordova plugin they are using since the old one hasn’t been updated for a while. During the change the reference to the plugin has’t been updated so it’s broken. (See: plugin_not_installed error with ionic · Issue #8 · silkimen/cordova-plugin-advanced-http · GitHub)

You can fix it by changing the old referenced plugin to new one: (After the commit also updating the plugin will fix the issue)

in @ionic-native/plugins/http/index.ts:

change:

pluginRef: ‘cordovaHTTP’,

to:

pluginRef: ‘cordova.plugin.http’,

See commit: Plugin ref fix · danielsogl/awesome-cordova-plugins@49ee0d8 · GitHub

2 Likes

Thank you. It worked.

I installed the plugin just yesterday, but it is still wrong.

Can I make a request to a fixed url with angulars HTTP. So not relative but like this https://anydomain.com/api/thing

Will I not run into CORs issues with that? Or is there a way around it using angular HTTP?
Keep in mind that I do not have control over the code or response from the URL.

Is anyone still facing the issue? I am getting a same error now

Native: tried calling HTTP.setDataSerializer, but the HTTP plugin is not installed.
Install the HTTP plugin: 'ionic cordova plugin add cordova-plugin-advanced-http'

My 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) : 7.1.0 

local packages:

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

System:

    ios-deploy : 1.9.2 
    ios-sim    : 6.1.2 
    Node       : v9.3.0
    npm        : 5.5.1 
    OS         : macOS High Sierra
    Xcode      : Xcode 9.2 Build version 9C40b 

and my plugin and node module version

cordova-plugin-advanced-http@1.11.0
@ionic-native/core@4.5.3
@ionic-native/http@4.5.3

Any help please?

@maruti
I think the platform is not ready when you call it. Try wrap it inside a platform.ready().

1 Like

Hi@Mcelogomes
My suggestion is to install like this and also import it to your root module
like
import { HTTP } from '@ionic-native/http';

   ionic cordova plugin add cordova-plugin-advanced-http
   npm install --save @ionic-native/http

Thanks @tokuhara, your solution worked for me.