Search code examples
cameracordova-pluginsqr-codeionic4

Ionic App shows blank screen when I add QRScanner


As soon as I add the QrScanner module to my Ionic App i just get a plain white screen.

I installed the Plugin by running the following two commands:

$ ionic cordova plugin add cordova-plugin-qrscanner
$ npm install --save @ionic-native/qr-scanner

After that i added it to my AppModule:

@NgModule({
  declarations: [AppComponent],
  entryComponents: [],
  imports: [BrowserModule, IonicModule.forRoot(), AppRoutingModule],
  providers: [
    StatusBar,
    SplashScreen,
    { provide: RouteReuseStrategy, useClass: IonicRouteStrategy },
    QRScanner
  ],
  bootstrap: [AppComponent]
})
export class AppModule {}

As soon as i remove the QRScanner from my providers, the app shows the content it should display. I am using a blank ionic app with Ionic4.

I even tried a tutorial but i haven't been successful

https://medium.com/@piashsarker/native-qr-scanner-implementation-in-ionic-6e1ef01335ea


Solution

  • I tested it and on ionic3 with this tutorial it works.

    So my answer: use ionic3