Ionic 4 White screen

Hey guys,

I’m working on an app which uses the SQLite plugin.

All worked fine till friday, when my app crashed and the config.xml became corrupted. I made a new project installed all the plugins again put the code back(generated pages with the cli command and rewrote the code).
It all worked fine again did have a white screen but a second startup did what it had to do.

now I’m starting up my app with ionic cordova run android, it starts the app loads the splashscreen but then I get a white screen.
While running the debugger I get this:

App successfully launched
Attaching to android
Forwarding debug port
Attaching to app.
Native: tried accessing the SQLite plugin but it's not installed.                         common.js:272
Install the SQLite plugin: 'ionic cordova plugin add cordova-sqlite-storage'      common.js:275
ERROR                                                                                                              AppModule:1
Error: Failed to create db connection                                                                 AppModule:1
ERROR CONTEXT                                                                                            AppModule:1
DebugContext_ {view: Object, nodeIndex: 1, nodeDef: Object, elDef: Object, elView: Object}
AppModule:1
Error: Failed to create db connection                                                                 main.ts:12
Ionic Native: deviceready event fired after 548 ms                                            bootstrap.js:10

SQLite is installed, and I even re-installed it but didn’t work.
When my app starts I load up my SQL in app.component.ts which calls my function initSql()
Which is in a global service:

import { SQLite, SQLiteObject } from '@ionic-native/sqlite/ngx';
private db: SQLiteObject;  public initSql() {
    const conn =  this.sqlite.create({
      name: 'berichten.db',
      location: 'default'
    });
    if (conn == null) {throw Error('Failed to create db connection'); }
    conn.then((data) => {
      this.db = data;
      // tslint:disable-next-line:max-line-length
      this.db.executeSql('CREATE TABLE IF NOT EXISTS berichten (ID INTEGER PRIMARY KEY AUTOINCREMENT, title TEXT, `text` TEXT, date NUMERIC)', [] ).then(() => {
        this.notifications = this.getNotifications();
      })
      .catch(error => console.error('sqlite create error', error));
    }).catch(error => console.error('initsql', error));
  }

What I did notice:
When I disable the initSql() in my app.component the app does start.
The AppModule:1 is not an existing file in my project base folder(it does not link to src/app)

I’ve also tested the project on my colleague’s phone with the initSql() enabled, and it works.

Tomorrow I’ll be trying it on another phone

I hope I’ve provided enough information.

ionic info:

Ionic:

   ionic (Ionic CLI)             : 4.12.0 (C:\Users\Eigenaar\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework               : @ionic/angular 4.1.1
   @angular-devkit/build-angular : 0.13.6
   @angular-devkit/schematics    : 7.2.4
   @angular/cli                  : 7.3.6
   @ionic/angular-toolkit        : 1.4.0

Cordova:

   cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
   Cordova Platforms     : android 7.1.4, ios 4.5.5
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 3.1.2, (and 11 other plugins)

System:

   NodeJS : v11.12.0 (C:\Program Files\nodejs\node.exe)
   npm    : 6.9.0
   OS     : Windows 10

same here. I assume you have an android phone with android 8.1 or android 9 on it, right?

I’m sitting on this issue for 2 days now.
I even tried to create a new project and just installed sqlite plugin and got the white screen.

I tried my app on older android version and it works there.

There was an update on android phones for android 9 on 5.03.19 and this update ruined everything. :rage::rage::rage:

einfach nur beschiessen

Have a look:

Thank you, your solution also worked for me.

On a side note, my colleague also has android version 9 and it worked fine for him.

The last android 9 update from Google was on 05.03.2019
If your colleague hasn’t updated his phone then you wouldn’t face this issue on his phone