HTTP plugin is not installed


#1

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

#2
  • 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?

#3

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?


#4

Angular’s Http is more friendly.


#5

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


#6

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:


#7

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


#8

Ionic native, Ionic 3


#9

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


#10

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


#11

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

#12

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: https://github.com/silkimen/cordova-plugin-advanced-http/issues/8)

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: https://github.com/ionic-team/ionic-native/commit/49ee0d85a304770a9a3bd3e04eb9609e6d565b67


#13

Thank you. It worked.

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


#14

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.


#15

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?


#16

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


#17

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