White screen on some device Android after loading

Hello Expert Ionic developer,
I built ionic 3 project android
ionic cordova build android --prod --release
It works on some devices but not working on some devices
Device is not working at my testing:

ionic info

cli packages: (/usr/local/lib/node_modules)

@ionic/cli-utils  : 1.9.2
ionic (Ionic CLI) : 3.9.2

global packages:

Cordova CLI : 7.0.1 

local packages:

@ionic/app-scripts : 2.1.3
Cordova Platforms  : android 6.2.3 ios 4.4.0
Ionic Framework    : ionic-angular 3.6.0


Android SDK Tools : 26.0.2
ios-deploy        : 1.9.1 
ios-sim           : 6.0.0 
Node              : v6.11.2
npm               : 3.10.10 
OS                : macOS Sierra
Xcode             : Xcode 8.3.3 Build version 8E3004b

I installed the apk file after built with command : ionic cordova build android
After about 1 minute waiting, show this log:

deviceready has not fired after 5 seconds. cordova.js:1223
Channel not fired: onDOMContentLoaded cordova.js:1216
Angular is running in the development mode. Call enableProdMode() to enable the production mode. vendor.js:3406
Native: deviceready did not fire within 5000ms. This can happen when plugins are in an inconsistent state. Try removing plugins from plugins/ and reinstalling them. vendor.js:108224
Ionic Native: deviceready did not fire within 5000ms. This can happen when plugins are in an inconsistent state. Try removing plugins from plugins/ and reinstalling them. vendor.js:214605
DEVICE READY FIRED AFTER 39769 ms vendor.js:108219
Ionic Native: deviceready event fired after 39659 ms
Any idea and advice, thanks.

My view is loaded and show banner advertisement, but still show white screen.
I debug with this command:
ionic cordova run android --prod

I tested many times on that device which is not working.
It will work fines if I removed --prod from release build
ionic cordova build android --release
And then I added

<preference name="loadUrlTimeoutValue" value="70000" />

to config.xml file

Work perfect on all devices Android.
So I think problem with build production.

Do you also get the problem when you build with --prod but without --release?

What is the list of plugins you are using? (ionic cordova plugin list)

Still happen without --release
Here is cordova plugin list:

cordova-admob-sdk 0.8.0 "AdMob SDK"
cordova-plugin-admob-free 0.10.0 "Cordova AdMob Plugin"
cordova-plugin-console 1.0.7 "Console"
cordova-plugin-device 1.1.6 "Device"
cordova-plugin-email-composer 0.8.7 "EmailComposer"
cordova-plugin-facebook4 1.9.1 "Facebook Connect"
cordova-plugin-googleplus 5.1.1 "Google SignIn"
cordova-plugin-inappbrowser 1.7.1 "InAppBrowser"
cordova-plugin-splashscreen 4.0.3 "Splashscreen"
cordova-plugin-statusbar 2.2.3 "StatusBar"
cordova-plugin-whitelist 1.3.2 "Whitelist"
cordova-plugin-wkwebview-engine 1.1.4-dev "Cordova WKWebView Engine"
cordova-plugin-x-socialsharing 5.1.8 "SocialSharing"
cordova-promise-polyfill 0.0.2 "cordova-promise-polyfill"
es6-promise-plugin 4.1.0 "Promise"
ionic-plugin-keyboard 2.2.1 “Keyboard”

Ok, so the culprit is --prod.

What version of Android is running on the devices where it is broken?
What version on the one where the app works as expected?

make me thing you might be targeting older Android versions…

2 device the same android version 6.0 but one works (Mobistar LAIZORO2, one don’t works (Meizu)

Can you post the complete log output of the working and the non-working device please?

I run the command

ionic cordova build android --prod

and install on both device, log the same. Very weird.
view is loaded ionViewDidLoad on both devices

  • I called show advertisement after view is loaded, it show advertisement on non-working device. :slight_smile:

Note: I add more cordova plugin, crosswalk webview for Android.
It is working but didn’t love that way, because increasing size apk file

So adding Crosswalk fixed the problem?

Then I guess some of the devices have an older native webview (Android Webview, it’s like an app that can be updated via the Play Store) that doesn’t support some functionality. Sounds very probably that the problem is appearing only with “obscure” devices as well.

Ah. Maybe. I checked it on google play store (this link https://play.google.com/store/apps/details?id=com.google.android.webview&hl=en)
On non-working device: This app is not compatible with your devices.
I will use crosswalk to fix them.
Many thanks

1 Like