Ionic4 white screen

Hello.

I have some problem.

When I run android without --prod, it is ok.

but, when I run android with --prod, white screen is shown.

I checked error log.

how to fix it? plz.

ERROR Error: Uncaught (in promise): Error: StaticInjectorError[n -> e]:
StaticInjectorError(Platform: core)[n -> e]:
NullInjectorError: No provider for e!
Error: StaticInjectorError[n -> e]:
StaticInjectorError(Platform: core)[n -> e]:
NullInjectorError: No provider for e!
at t.CcnG.t.get (main.c71af0b9e8b86513fbc8.js:1)
at main.c71af0b9e8b86513fbc8.js:1
at t (main.c71af0b9e8b86513fbc8.js:1)
at t.CcnG.t.get (main.c71af0b9e8b86513fbc8.js:1)
at main.c71af0b9e8b86513fbc8.js:1
at t (main.c71af0b9e8b86513fbc8.js:1)
at t.CcnG.t.get (main.c71af0b9e8b86513fbc8.js:1)
at po (main.c71af0b9e8b86513fbc8.js:1)
at t.CcnG.t.get (main.c71af0b9e8b86513fbc8.js:1)
at po (main.c71af0b9e8b86513fbc8.js:1)
at t.CcnG.t.get (main.c71af0b9e8b86513fbc8.js:1)
at main.c71af0b9e8b86513fbc8.js:1
at t (main.c71af0b9e8b86513fbc8.js:1)
at t.CcnG.t.get (main.c71af0b9e8b86513fbc8.js:1)
at main.c71af0b9e8b86513fbc8.js:1
at t (main.c71af0b9e8b86513fbc8.js:1)
at t.CcnG.t.get (main.c71af0b9e8b86513fbc8.js:1)
at po (main.c71af0b9e8b86513fbc8.js:1)
at t.CcnG.t.get (main.c71af0b9e8b86513fbc8.js:1)
at po (main.c71af0b9e8b86513fbc8.js:1)
at P (polyfills.4601d1912f38da6a8049.js:1)
at P (polyfills.4601d1912f38da6a8049.js:1)
at polyfills.4601d1912f38da6a8049.js:1
at e.invokeTask (polyfills.4601d1912f38da6a8049.js:1)
at Object.onInvokeTask (main.c71af0b9e8b86513fbc8.js:1)
at e.invokeTask (polyfills.4601d1912f38da6a8049.js:1)
at t.runTask (polyfills.4601d1912f38da6a8049.js:1)
at g (polyfills.4601d1912f38da6a8049.js:1)
at

ionic info

Ionic:

ionic (Ionic CLI) : 4.11.0 (/usr/local/lib/node_modules/ionic)
Ionic Framework : @ionic/angular 4.1.1
@angular-devkit/build-angular : 0.13.5
@angular-devkit/schematics : 7.2.4
@angular/cli : 7.3.5
@ionic/angular-toolkit : 1.4.0

Cordova:

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

System:

Android SDK Tools : 26.1.1
ios-deploy : 1.9.4
ios-sim : 8.0.0
NodeJS : v10.15.3 (/usr/local/bin/node)
npm : 6.4.1
OS : macOS Mojave
Xcode : Xcode 10.1 Build version 10B61

1 Like

Which version of ionic-native you are using? If you are using v5.2.0, upgrade to v5.3.0 or revert to v5.1.0

The same bug for me.:expressionless:
ionic (Ionic CLI) : 4.12.0
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.0.0
Cordova Platforms : android 7.0.0
Cordova Plugins : no whitelisted plugins (0 plugins total)

System:

(D:\work\android-23): 25.2.5
NodeJS : v10.15.1 (C:\Program Files\nodejs\node.exe)
npm : 6.0.1
OS : Windows 10

I try upgrade ionic-native to v5.3.0 or to v5.1.0,can’t fix.

finally,i fix it.
i use some plugins like keyboard in some page, but not set providers in app.component.ts
but i added platform android before, i run android without --prod ,it is ok.
i rm platform android and re add it, it throw error.

My issue was that couple plugins did not inject properly into the app. I fixed this problem by specifying all my ionic-native plugins under providers in app.module.ts.