ionic-native/network-interface, gives error the 'plugin not installed'?


#1

I am using ionic-native/network-interface for getting the ip address of wifi I am connected with but It gives error Plugin not installed but I have installed it using official documentation.

This is the code I have written

> export class HomePage {
> 
>   constructor(public navCtrl: NavController, private networkInterface: NetworkInterface ) {
> 
>     this.networkInterface.getWiFiIPAddress().then(a=>alert(a)).catch(e=>alert(e));
> 
> }
> }

Error: plugin not installed

And I have addeed NetworkInterface in the providers in app.module.ts


#2

please try this
ionic cordova platform rm android
ionic cordova plugin add cordova-plugin-networkinterface
ionic cordova platform add android
ionic cordova build android