启动画面后白屏卡住

启动画面后白屏卡住

本文介绍了为什么在 Ionic 4 启动画面后白屏卡住?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为我的 Ionic Cordova 项目运行 ionic cordova run android.此时,我的手机通过 USB 连接到 PC.因此,当我运行该命令时,它会在我的真实设备 Android Redmi Note 6 PRO 上安装该应用.

但真正发生的是当应用程序打开时,只出现白屏,什么也没有.首先它显示闪屏,然后永远是白屏.为什么会发生这种行为?我在某处读到有人因为 Ionic 4 而遇到这个问题.

以下是我在 Android 模拟器上单击应用程序打开后的 logcat 日志(它在 Android 模拟器上也显示白屏).

2019-02-11 00:01:24.131 5945-5945/?I/zygote:未启用 -Xcheck:jni(已启用)2019-02-11 00:01:24.148 5945-5945/?W/zygote:使用默认值的 X86 的意外 CPU 变体:x862019-02-11 00:01:24.312 5945-5945/io.ionic.starter I/CordovaLog:将日志级别更改为调试 (3)2019-02-11 00:01:24.312 5945-5945/io.ionic.starter I/CordovaActivity:Apache Cordova 本机平台版本 7.1.4 正在启动2019-02-11 00:01:24.312 5945-5945/io.ionic.starter D/CordovaActivity:CordovaActivity.onCreate()2019-02-11 00:01:24.342 5945-5945/io.ionic.starter I/WebViewFactory:加载 com.android.chrome 版本 61.0.3163.98(代码 316409812)2019-02-11 00:01:24.350 5945-5945/io.ionic.starter I/zygote:ClassLoaderContext 是一个特殊的共享库.2019-02-11 00:01:24.392 5945-5945/io.ionic.starter I/cr_LibraryLoader:加载本机库的时间:8 毫秒(时间戳 2894-2902)2019-02-11 00:01:24.421 5945-5945/io.ionic.starter I/chromium:[INFO:library_loader_hooks.cc(136)] Chromium 日志记录已启用:级别 = 0,默认详细程度 = 02019-02-11 00:01:24.422 5945-5945/io.ionic.starter I/cr_LibraryLoader:预期本机库版本号61.0.3163.98",实际本机库版本号61.0.3163.98"2019-02-11 00:01:24.436 5945-5963/io.ionic.starter W/cr_ChildProcLH:创建一个新的 ChildConnectionAllocator,包名 = com.android.chrome,sandboxed = true2019-02-11 00:01:24.464 5945-5945/io.ionic.starter I/cr_BrowserStartup:初始化铬进程,singleProcess=false2019-02-11 00:01:24.513 5945-5945/io.ionic.starter W/o.ionic.starter:type=1400 审计(0.0:48):avc:拒绝 { read } for name="vmstat" dev="proc" ino=4026532039 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:proc:s0 tclass=file permissive=02019-02-11 00:01:24.544 5945-5945/io.ionic.starter I/zygote:android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay 检索到:02019-02-11 00:01:24.553 5945-5945/io.ionic.starter D/EGL_emulation:eglCreateContext:0xa4516160:maj 3 min 0 rcv 32019-02-11 00:01:24.555 5945-5945/io.ionic.starter D/EGL_emulation: eglMakeCurrent: 0xa4516160: ver 3 0 (tinfo 0x94123730)2019 年 2 月 11 日 00:01:24.635 5945-5945/io.ionic.starter D/IonicWebViewEngine:Ionic Web 视图引擎立即启动 1...2019 年 2 月 11 日 00:01:24.659 5945-5945/io.ionic.starter D/SystemWebViewEngine:CordovaWebView 在设备上运行:Google2019-02-11 00:01:24.675 5945-5945/io.ionic.starter D/PluginManager: init()2019-02-11 00:01:24.718 5945-5999/io.ionic.starter D/OpenGLRenderer:HWUI GL 管道2019-02-11 00:01:24.787 5945-5945/io.ionic.starter D/CordovaWebViewImpl:>>>loadUrl(file:///android_asset/www/index.html)2019-02-11 00:01:24.793 5945-5963/io.ionic.starter I/cr_LibraryLoader:使用链接器:org.chromium.base.library_loader.ModernLinker2019-02-11 00:01:24.795 5945-5992/io.ionic.starter W/cr_media:需要蓝牙权限2019-02-11 00:01:24.800 5945-5945/io.ionic.starter D/CordovaActivity:开始活动.2019-02-11 00:01:24.805 5945-5945/io.ionic.starter D/CordovaActivity:恢复活动.2019-02-11 00:01:24.834 5945-5999/io.ionic.starter I/OpenGLRenderer:初始化 EGL,版本 1.42019-02-11 00:01:24.834 5945-5999/io.ionic.starter D/OpenGLRenderer:交换行为 12019-02-11 00:01:24.836 5945-5999/io.ionic.starter W/OpenGLRenderer:无法选择带有 EGL_SWAP_BEHAVIOR_PRESERVED 的配置,重试没有...2019-02-11 00:01:24.836 5945-5999/io.ionic.starter D/OpenGLRenderer:交换行为 02019-02-11 00:01:24.856 5945-5999/io.ionic.starter D/EGL_emulation:eglCreateContext:0xa48062c0:maj 3 min 0 rcv 32019-02-11 00:01:24.871 5945-5999/io.ionic.starter D/EGL_emulation: eglMakeCurrent: 0xa48062c0: ver 3 0 (tinfo 0xa48038d0)2019-02-11 00:01:25.188 5945-5999/io.ionic.starter D/EGL_emulation: eglMakeCurrent: 0xa48062c0: ver 3 0 (tinfo 0xa48038d0)2019-02-11 00:01:25.209 5945-6010/io.ionic.starter D/EGL_emulation:eglCreateContext:0x94170560:maj 3 min 0 rcv 32019-02-11 00:01:25.212 5945-6010/io.ionic.starter D/EGL_emulation: eglMakeCurrent: 0x94170560: ver 3 0 (tinfo 0x92f2a180)2019-02-11 00:01:25.302 5945-6010/io.ionic.starter I/VideoCapabilities:不支持的视频/mp4v-es 配置文件 42019-02-11 00:01:25.302 5945-5999/io.ionic.starter D/EGL_emulation: eglMakeCurrent: 0xa48062c0: ver 3 0 (tinfo 0xa48038d0)2019-02-11 00:01:25.313 5945-6010/io.ionic.starter W/cr_MediaCodecUtil:此设备上不提供用于视频/avc 的硬件编码器.2019-02-11 00:01:25.372 5945-5999/io.ionic.starter D/EGL_emulation: eglMakeCurrent: 0xa48062c0: ver 3 0 (tinfo 0xa48038d0)2019-02-11 00:01:25.450 5945-5999/io.ionic.starter D/EGL_emulation: eglMakeCurrent: 0xa48062c0: ver 3 0 (tinfo 0xa48038d0)2019-02-11 00:01:25.458 5945-6010/io.ionic.starter D/EGL_emulation:eglCreateContext:0x941716a0:maj 3 min 0 rcv 32019-02-11 00:01:25.460 5945-6010/io.ionic.starter D/EGL_emulation: eglMakeCurrent: 0x941716a0: ver 3 0 (tinfo 0x92f2a180)2019-02-11 00:01:25.537 5945-6012/io.ionic.starter W/cr_CrashFileManager:/data/user/0/io.ionic.starter/cache/WebView/Crash Reports 不存在或不是目录2019-02-11 00:01:25.537 5945-5950/io.ionic.starter I/zygote:做部分代码缓存收集,代码=22KB,数据=30KB2019-02-11 00:01:25.541 5945-5950/io.ionic.starter I/zygote:代码缓存收集后,代码=22KB,数据=30KB2019-02-11 00:01:25.541 5945-5950/io.ionic.starter I/zygote:将代码缓存容量增加到 128KB2019-02-11 00:01:25.546 5945-5945/io.ionic.starter D/CordovaWebViewImpl: onPageDidNavigate(file:///android_asset/www/index.html)2019-02-11 00:01:25.611 5945-5945/io.ionic.starter D/CordovaWebViewImpl: onPageFinished(file:///android_asset/www/index.html)2019-02-11 00:01:25.619 5945-5945/io.ionic.starter D/CordovaWebViewImpl: onPageDidNavigate(http://localhost/)2019-02-11 00:01:25.619 5945-5988/io.ionic.starter D/SERVER:处理本地请求:http://localhost/2019-02-11 00:01:25.640 5945-5988/io.ionic.starter D/SERVER:处理本地请求:http://localhost/runtime.js2019-02-11 00:01:25.641 5945-5988/io.ionic.starter D/SERVER:处理本地请求:http://localhost/polyfills.js2019-02-11 00:01:25.644 5945-5988/io.ionic.starter D/SERVER:处理本地请求:http://localhost/styles.js2019-02-11 00:01:25.645 5945-5988/io.ionic.starter D/SERVER:处理本地请求:http://localhost/cordova.js2019-02-11 00:01:25.646 5945-5988/io.ionic.starter D/SERVER:处理本地请求:http://localhost/vendor.js2019-02-11 00:01:25.647 5945-5988/io.ionic.starter D/SERVER:处理本地请求:http://localhost/main.js2019-02-11 00:01:25.663 5945-5945/io.ionic.starter D/SystemWebChromeClient: http://localhost/: Line 10 :无法识别并忽略键viewport-fit".2019-02-11 00:01:25.663 5945-5945/io.ionic.starter I/chromium:[INFO:CONSOLE(10)]未识别和忽略关键viewport-fit".",来源:http://本地主机/(10)2019-02-11 00:01:25.997 5945-5991/io.ionic.starter E/chromium: [ERROR:service_manager.cc(156)] Connection InterfaceProviderSpec 阻止服务:content_renderer 绑定接口:blink::mojom::BudgetService暴露者:content_browser2019-02-11 00:01:26.012 5945-5945/io.ionic.starter D/JsMessageQueue:将本机-> JS 模式设置为 EvalBridgeMode2019-02-11 00:01:26.083 5945-5988/io.ionic.starter D/SERVER:处理本地请求:http://localhost/cordova_plugins.js2019-02-11 00:01:26.101 5945-5988/io.ionic.starter D/SERVER:处理本地请求:http://localhost/plugins/cordova-plugin-statusbar/www/statusbar.js2019-02-11 00:01:26.102 5945-5988/io.ionic.starter D/SERVER:处理本地请求:http://localhost/plugins/cordova-plugin-device/www/device.js2019-02-11 00:01:26.106 5945-5988/io.ionic.starter D/SERVER:处理本地请求:http://localhost/plugins/cordova-plugin-splashscreen/www/splashscreen.js2019-02-11 00:01:26.107 5945-5988/io.ionic.starter D/SERVER:处理本地请求:http://localhost/plugins/cordova-plugin-ionic-webview/src/www/util.js2019-02-11 00:01:26.108 5945-5988/io.ionic.starter D/SERVER:处理本地请求:http://localhost/plugins/cordova-plugin-ionic-keyboard/www/android/keyboard.js2019-02-11 00:01:26.201 5945-5945/io.ionic.starter W/zygote:尝试删除非 JNI 本地引用,转储线程2019-02-11 00:01:26.213 5945-5999/io.ionic.starter D/EGL_emulation: eglMakeCurrent: 0xa48062c0: ver 3 0 (tinfo 0xa48038d0)2019-02-11 00:01:26.268 5945-5999/io.ionic.starter D/EGL_emulation: eglMakeCurrent: 0xa48062c0: ver 3 0 (tinfo 0xa48038d0)2019-02-11 00:01:27.505 5945-5999/io.ionic.starter D/EGL_emulation: eglMakeCurrent: 0xa48062c0: ver 3 0 (tinfo 0xa48038d0)2019-02-11 00:01:27.812 5945-5945/io.ionic.starter W/zygote:尝试删除非 JNI 本地引用,转储线程2019-02-11 00:01:27.826 5945-5999/io.ionic.starter D/EGL_emulation: eglMakeCurrent: 0xa48062c0: ver 3 0 (tinfo 0xa48038d0)2019-02-11 00:01:27.878 5945-5945/io.ionic.starter W/zygote:尝试删除非 JNI 本地引用,转储线程2019-02-11 00:01:27.887 5945-5945/io.ionic.starter D/SystemWebChromeClient:http://localhost/main.js:第 3385 行:TypeError:无法读取 null 的属性应用"2019-02-11 00:01:27.887 5945-5945/io.ionic.starter I/chromium: [INFO:CONSOLE(3385)] "TypeError: 无法读取属性 'apply' of null",来源:http://本地主机/main.js (3385)2019-02-11 00:01:27.894 5945-5945/io.ionic.starter D/SystemWebChromeClient: http://localhost/vendor.js: Line 75947: Ionic Native: deviceready 事件在 973 ms 后触发2019-02-11 00:01:27.895 5945-5945/io.ionic.starter I/chromium: [INFO:CONSOLE(75947)] Ionic Native: deviceready 事件在 973 ms 后触发",来源:http://localhost/vendor.js (75947)2019-02-11 00:01:27.896 5945-5988/io.ionic.starter D/SERVER:处理本地请求:http://localhost/assets/icon/favicon.png2019-02-11 00:01:27.916 5945-5945/io.ionic.starter W/zygote:尝试删除非 JNI 本地引用,转储线程2019-02-11 00:01:27.924 5945-5945/io.ionic.starter D/CordovaWebViewImpl: onPageFinished(http://localhost/)2019-02-11 00:01:27.951 5945-5945/io.ionic.starter W/zygote:尝试删除非 JNI 本地引用,转储线程2019-02-11 00:01:28.063 5945-5945/io.ionic.starter I/chatty: uid=10080(io.ionic.starter) 相同的 3 行2019-02-11 00:01:28.110 5945-5945/io.ionic.starter W/zygote:尝试删除非 JNI 本地引用,转储线程

Chrome 调试器显示:

TypeError: 无法读取 null 的属性 'apply'在 vendor.js:88820在 NgRedux.push../node_modules/ng2-redux/lib/components/ng-redux.js.NgRedux.configureStore (vendor.js:87925)在新的 AppModule (main.js:1511)在 _createClass (vendor.js:56970)在 _createProviderInstance (vendor.js:56940)在 initNgModule (vendor.js:56873)在新的 NgModuleRef_ (vendor.js:57600)在 createNgModuleRef (vendor.js:57589)在 Object.debugCreateNgModuleRef [as createNgModuleRef] (vendor.js:59420)在 NgModuleFactory_.push../node_modules/@angular/core/fesm5/core.js.NgModuleFactory_.create (vendor.js:60124)vendor.js:75947 Ionic Native:776 毫秒后触发 deviceready 事件
解决方案

我通过在 config.xml 上设置正确的参数解决了这个问题

然后,在我的 platform.ready() 指令中,我所做的就是 Splashscreen.hide() 然后在 android 上运行该项目.

ionic cordova 运行 android

I run ionic cordova run android for my Ionic Cordova project. At this time, I have my mobile connected to PC via USB. So when I run that command, it installs the app on my real device Android Redmi Note 6 PRO.

But what really happens is when the app opens, only white screen appears, nothing else at all. First it shows splash screen and then white screen forever. Why does this behaviour happen? I read somewhere that some people had this problem because of Ionic 4.

Below are my logcat logs from after I click the app to open on Android emulator (it shows white screen also on Android emulator).

2019-02-11 00:01:24.131 5945-5945/? I/zygote: Not late-enabling -Xcheck:jni (already on)
2019-02-11 00:01:24.148 5945-5945/? W/zygote: Unexpected CPU variant for X86 using defaults: x86
2019-02-11 00:01:24.312 5945-5945/io.ionic.starter I/CordovaLog: Changing log level to DEBUG(3)
2019-02-11 00:01:24.312 5945-5945/io.ionic.starter I/CordovaActivity: Apache Cordova native platform version 7.1.4 is starting
2019-02-11 00:01:24.312 5945-5945/io.ionic.starter D/CordovaActivity: CordovaActivity.onCreate()
2019-02-11 00:01:24.342 5945-5945/io.ionic.starter I/WebViewFactory: Loading com.android.chrome version 61.0.3163.98 (code 316409812)
2019-02-11 00:01:24.350 5945-5945/io.ionic.starter I/zygote: The ClassLoaderContext is a special shared library.
2019-02-11 00:01:24.392 5945-5945/io.ionic.starter I/cr_LibraryLoader: Time to load native libraries: 8 ms (timestamps 2894-2902)
2019-02-11 00:01:24.421 5945-5945/io.ionic.starter I/chromium: [INFO:library_loader_hooks.cc(136)] Chromium logging enabled: level = 0, default verbosity = 0
2019-02-11 00:01:24.422 5945-5945/io.ionic.starter I/cr_LibraryLoader: Expected native library version number "61.0.3163.98", actual native library version number "61.0.3163.98"
2019-02-11 00:01:24.436 5945-5963/io.ionic.starter W/cr_ChildProcLH: Create a new ChildConnectionAllocator with package name = com.android.chrome, sandboxed = true
2019-02-11 00:01:24.464 5945-5945/io.ionic.starter I/cr_BrowserStartup: Initializing chromium process, singleProcess=false
2019-02-11 00:01:24.513 5945-5945/io.ionic.starter W/o.ionic.starter: type=1400 audit(0.0:48): avc: denied { read } for name="vmstat" dev="proc" ino=4026532039 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:proc:s0 tclass=file permissive=0
2019-02-11 00:01:24.544 5945-5945/io.ionic.starter I/zygote: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 0
2019-02-11 00:01:24.553 5945-5945/io.ionic.starter D/EGL_emulation: eglCreateContext: 0xa4516160: maj 3 min 0 rcv 3
2019-02-11 00:01:24.555 5945-5945/io.ionic.starter D/EGL_emulation: eglMakeCurrent: 0xa4516160: ver 3 0 (tinfo 0x94123730)
2019-02-11 00:01:24.635 5945-5945/io.ionic.starter D/IonicWebViewEngine: Ionic Web View Engine Starting Right Up 1...
2019-02-11 00:01:24.659 5945-5945/io.ionic.starter D/SystemWebViewEngine: CordovaWebView is running on device made by: Google
2019-02-11 00:01:24.675 5945-5945/io.ionic.starter D/PluginManager: init()
2019-02-11 00:01:24.718 5945-5999/io.ionic.starter D/OpenGLRenderer: HWUI GL Pipeline
2019-02-11 00:01:24.787 5945-5945/io.ionic.starter D/CordovaWebViewImpl: >>> loadUrl(file:///android_asset/www/index.html)
2019-02-11 00:01:24.793 5945-5963/io.ionic.starter I/cr_LibraryLoader: Using linker: org.chromium.base.library_loader.ModernLinker
2019-02-11 00:01:24.795 5945-5992/io.ionic.starter W/cr_media: Requires BLUETOOTH permission
2019-02-11 00:01:24.800 5945-5945/io.ionic.starter D/CordovaActivity: Started the activity.
2019-02-11 00:01:24.805 5945-5945/io.ionic.starter D/CordovaActivity: Resumed the activity.
2019-02-11 00:01:24.834 5945-5999/io.ionic.starter I/OpenGLRenderer: Initialized EGL, version 1.4
2019-02-11 00:01:24.834 5945-5999/io.ionic.starter D/OpenGLRenderer: Swap behavior 1
2019-02-11 00:01:24.836 5945-5999/io.ionic.starter W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
2019-02-11 00:01:24.836 5945-5999/io.ionic.starter D/OpenGLRenderer: Swap behavior 0
2019-02-11 00:01:24.856 5945-5999/io.ionic.starter D/EGL_emulation: eglCreateContext: 0xa48062c0: maj 3 min 0 rcv 3
2019-02-11 00:01:24.871 5945-5999/io.ionic.starter D/EGL_emulation: eglMakeCurrent: 0xa48062c0: ver 3 0 (tinfo 0xa48038d0)
2019-02-11 00:01:25.188 5945-5999/io.ionic.starter D/EGL_emulation: eglMakeCurrent: 0xa48062c0: ver 3 0 (tinfo 0xa48038d0)
2019-02-11 00:01:25.209 5945-6010/io.ionic.starter D/EGL_emulation: eglCreateContext: 0x94170560: maj 3 min 0 rcv 3
2019-02-11 00:01:25.212 5945-6010/io.ionic.starter D/EGL_emulation: eglMakeCurrent: 0x94170560: ver 3 0 (tinfo 0x92f2a180)
2019-02-11 00:01:25.302 5945-6010/io.ionic.starter I/VideoCapabilities: Unsupported profile 4 for video/mp4v-es
2019-02-11 00:01:25.302 5945-5999/io.ionic.starter D/EGL_emulation: eglMakeCurrent: 0xa48062c0: ver 3 0 (tinfo 0xa48038d0)
2019-02-11 00:01:25.313 5945-6010/io.ionic.starter W/cr_MediaCodecUtil: HW encoder for video/avc is not available on this device.
2019-02-11 00:01:25.372 5945-5999/io.ionic.starter D/EGL_emulation: eglMakeCurrent: 0xa48062c0: ver 3 0 (tinfo 0xa48038d0)
2019-02-11 00:01:25.450 5945-5999/io.ionic.starter D/EGL_emulation: eglMakeCurrent: 0xa48062c0: ver 3 0 (tinfo 0xa48038d0)
2019-02-11 00:01:25.458 5945-6010/io.ionic.starter D/EGL_emulation: eglCreateContext: 0x941716a0: maj 3 min 0 rcv 3
2019-02-11 00:01:25.460 5945-6010/io.ionic.starter D/EGL_emulation: eglMakeCurrent: 0x941716a0: ver 3 0 (tinfo 0x92f2a180)
2019-02-11 00:01:25.537 5945-6012/io.ionic.starter W/cr_CrashFileManager: /data/user/0/io.ionic.starter/cache/WebView/Crash Reports does not exist or is not a directory
2019-02-11 00:01:25.537 5945-5950/io.ionic.starter I/zygote: Do partial code cache collection, code=22KB, data=30KB
2019-02-11 00:01:25.541 5945-5950/io.ionic.starter I/zygote: After code cache collection, code=22KB, data=30KB
2019-02-11 00:01:25.541 5945-5950/io.ionic.starter I/zygote: Increasing code cache capacity to 128KB
2019-02-11 00:01:25.546 5945-5945/io.ionic.starter D/CordovaWebViewImpl: onPageDidNavigate(file:///android_asset/www/index.html)
2019-02-11 00:01:25.611 5945-5945/io.ionic.starter D/CordovaWebViewImpl: onPageFinished(file:///android_asset/www/index.html)
2019-02-11 00:01:25.619 5945-5945/io.ionic.starter D/CordovaWebViewImpl: onPageDidNavigate(http://localhost/)
2019-02-11 00:01:25.619 5945-5988/io.ionic.starter D/SERVER: Handling local request: http://localhost/
2019-02-11 00:01:25.640 5945-5988/io.ionic.starter D/SERVER: Handling local request: http://localhost/runtime.js
2019-02-11 00:01:25.641 5945-5988/io.ionic.starter D/SERVER: Handling local request: http://localhost/polyfills.js
2019-02-11 00:01:25.644 5945-5988/io.ionic.starter D/SERVER: Handling local request: http://localhost/styles.js
2019-02-11 00:01:25.645 5945-5988/io.ionic.starter D/SERVER: Handling local request: http://localhost/cordova.js
2019-02-11 00:01:25.646 5945-5988/io.ionic.starter D/SERVER: Handling local request: http://localhost/vendor.js
2019-02-11 00:01:25.647 5945-5988/io.ionic.starter D/SERVER: Handling local request: http://localhost/main.js
2019-02-11 00:01:25.663 5945-5945/io.ionic.starter D/SystemWebChromeClient: http://localhost/: Line 10 : The key "viewport-fit" is not recognized and ignored.
2019-02-11 00:01:25.663 5945-5945/io.ionic.starter I/chromium: [INFO:CONSOLE(10)] "The key "viewport-fit" is not recognized and ignored.", source: http://localhost/ (10)
2019-02-11 00:01:25.997 5945-5991/io.ionic.starter E/chromium: [ERROR:service_manager.cc(156)] Connection InterfaceProviderSpec prevented service: content_renderer from binding interface: blink::mojom::BudgetService exposed by: content_browser
2019-02-11 00:01:26.012 5945-5945/io.ionic.starter D/JsMessageQueue: Set native->JS mode to EvalBridgeMode
2019-02-11 00:01:26.083 5945-5988/io.ionic.starter D/SERVER: Handling local request: http://localhost/cordova_plugins.js
2019-02-11 00:01:26.101 5945-5988/io.ionic.starter D/SERVER: Handling local request: http://localhost/plugins/cordova-plugin-statusbar/www/statusbar.js
2019-02-11 00:01:26.102 5945-5988/io.ionic.starter D/SERVER: Handling local request: http://localhost/plugins/cordova-plugin-device/www/device.js
2019-02-11 00:01:26.106 5945-5988/io.ionic.starter D/SERVER: Handling local request: http://localhost/plugins/cordova-plugin-splashscreen/www/splashscreen.js
2019-02-11 00:01:26.107 5945-5988/io.ionic.starter D/SERVER: Handling local request: http://localhost/plugins/cordova-plugin-ionic-webview/src/www/util.js
2019-02-11 00:01:26.108 5945-5988/io.ionic.starter D/SERVER: Handling local request: http://localhost/plugins/cordova-plugin-ionic-keyboard/www/android/keyboard.js
2019-02-11 00:01:26.201 5945-5945/io.ionic.starter W/zygote: Attempt to remove non-JNI local reference, dumping thread
2019-02-11 00:01:26.213 5945-5999/io.ionic.starter D/EGL_emulation: eglMakeCurrent: 0xa48062c0: ver 3 0 (tinfo 0xa48038d0)
2019-02-11 00:01:26.268 5945-5999/io.ionic.starter D/EGL_emulation: eglMakeCurrent: 0xa48062c0: ver 3 0 (tinfo 0xa48038d0)
2019-02-11 00:01:27.505 5945-5999/io.ionic.starter D/EGL_emulation: eglMakeCurrent: 0xa48062c0: ver 3 0 (tinfo 0xa48038d0)
2019-02-11 00:01:27.812 5945-5945/io.ionic.starter W/zygote: Attempt to remove non-JNI local reference, dumping thread
2019-02-11 00:01:27.826 5945-5999/io.ionic.starter D/EGL_emulation: eglMakeCurrent: 0xa48062c0: ver 3 0 (tinfo 0xa48038d0)
2019-02-11 00:01:27.878 5945-5945/io.ionic.starter W/zygote: Attempt to remove non-JNI local reference, dumping thread
2019-02-11 00:01:27.887 5945-5945/io.ionic.starter D/SystemWebChromeClient: http://localhost/main.js: Line 3385 : TypeError: Cannot read property 'apply' of null
2019-02-11 00:01:27.887 5945-5945/io.ionic.starter I/chromium: [INFO:CONSOLE(3385)] "TypeError: Cannot read property 'apply' of null", source: http://localhost/main.js (3385)
2019-02-11 00:01:27.894 5945-5945/io.ionic.starter D/SystemWebChromeClient: http://localhost/vendor.js: Line 75947 : Ionic Native: deviceready event fired after 973 ms
2019-02-11 00:01:27.895 5945-5945/io.ionic.starter I/chromium: [INFO:CONSOLE(75947)] "Ionic Native: deviceready event fired after 973 ms", source: http://localhost/vendor.js (75947)
2019-02-11 00:01:27.896 5945-5988/io.ionic.starter D/SERVER: Handling local request: http://localhost/assets/icon/favicon.png
2019-02-11 00:01:27.916 5945-5945/io.ionic.starter W/zygote: Attempt to remove non-JNI local reference, dumping thread
2019-02-11 00:01:27.924 5945-5945/io.ionic.starter D/CordovaWebViewImpl: onPageFinished(http://localhost/)
2019-02-11 00:01:27.951 5945-5945/io.ionic.starter W/zygote: Attempt to remove non-JNI local reference, dumping thread
2019-02-11 00:01:28.063 5945-5945/io.ionic.starter I/chatty: uid=10080(io.ionic.starter) identical 3 lines
2019-02-11 00:01:28.110 5945-5945/io.ionic.starter W/zygote: Attempt to remove non-JNI local reference, dumping thread

Chrome debugger shows:

TypeError: Cannot read property 'apply' of null
    at vendor.js:88820
    at NgRedux.push../node_modules/ng2-redux/lib/components/ng-redux.js.NgRedux.configureStore (vendor.js:87925)
    at new AppModule (main.js:1511)
    at _createClass (vendor.js:56970)
    at _createProviderInstance (vendor.js:56940)
    at initNgModule (vendor.js:56873)
    at new NgModuleRef_ (vendor.js:57600)
    at createNgModuleRef (vendor.js:57589)
    at Object.debugCreateNgModuleRef [as createNgModuleRef] (vendor.js:59420)
    at NgModuleFactory_.push../node_modules/@angular/core/fesm5/core.js.NgModuleFactory_.create (vendor.js:60124)
vendor.js:75947 Ionic Native: deviceready event fired after 776 ms
解决方案

I’ve solved this issue by setting the correct parameters on config.xml

<preference name="AutoHideSplashScreen" value="false" />
<preference name="SplashScreenDelay" value="10000" />
<preference name="FadeSplashScreenDuration" value="1000" />
<preference name="SplashScreen" value="screen" />
<preference name="ShowSplashScreen" value="true" />
<preference name="ShowSplashScreenSpinner" value="false" />
<preference name="SplashShowOnlyFirstTime" value="false" />
<preference name="FadeSplashScreen" value="true" />

Then, on my platform.ready() instruction all I do is Splashscreen.hide() and after that run the project on android using.

ionic cordova run android

这篇关于为什么在 Ionic 4 启动画面后白屏卡住?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-12 00:18