Cannot add webview to app module

Any clues how to use the WebView plugin please?

I have created a new ionic app and done nothing else but add file and webview plug ins. When I try to add webview to the list of providers in my app module I get errors showing all over the place in Visual Studio code and it wont run in the simulator.

This is my set up, which I think is up to date.

Ionic:

ionic (Ionic CLI) : 4.1.1 (/usr/local/lib/node_modules/ionic)
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.2.0

Cordova:

cordova (Cordova CLI) : 8.0.0
Cordova Platforms : ios 4.5.5
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.2, cordova-plugin-ionic-webview 2.1.0, (and 5 other plugins)

System:

ios-deploy : 1.9.2
ios-sim : 6.0.0
NodeJS : v8.11.3 (/usr/local/bin/node)
npm : 5.6.0
OS : macOS High Sierra
Xcode : Xcode 9.3 Build version 9E145

This is what I tried in my app module but it shows lots of errors and doesnt work. The context help in visual studio says a long error message including ‘Types of property providers are incompatible’

import { BrowserModule } from ‘@angular/platform-browser’;
import { ErrorHandler, NgModule } from ‘@angular/core’;
import { IonicApp, IonicErrorHandler, IonicModule } from ‘ionic-angular’;
import { SplashScreen } from ‘@ionic-native/splash-screen’;
import { StatusBar } from ‘@ionic-native/status-bar’;

import { MyApp } from ‘./app.component’;
import { HomePage } from ‘…/pages/home/home’;
import { File } from ‘@ionic-native/file’;
import { WebView } from ‘@ionic-native/ionic-webview’;

@NgModule({
declarations: [
MyApp,
HomePage,

],
imports: [
BrowserModule,
IonicModule.forRoot(MyApp),

],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
HomePage,

],
providers: [
StatusBar,
SplashScreen,

{provide: ErrorHandler, useClass: IonicErrorHandler},
File,
WebView

]
})
export class AppModule {}

1 Like

having the exact same issue here and struggling with it.

I got this error too :cold_sweat: