Cordova - 启动后出现白屏,控制台中没有异常 [英] Cordova - white screen after splash, no exceptions in console

查看:48
本文介绍了Cordova - 启动后出现白屏,控制台中没有异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我离开我的 Cordova 应用程序有一段时间了,但昨天刚刚做了一个新的克隆,并注意到它有白屏死机"症状——启动画面显示,程序加载......和然后我只是得到一个空白屏幕.更多细节:

I've been away from my Cordova app for a bit, but just did a fresh clone yesterday and noticed that it's got the "white screen of death" symptoms -- the splash screen displays, the program loads... and then I just get a blank screen. Some more details:

  • CLI:Cordova 6.1.1、安卓 5.1.1、ios 4.1.1
  • 我没有使用任何特殊插件来显示启动画面——只是在 我的 config.xml 文件.
  • 这种情况发生在 iOS 和 Android 中,无论是在本地构建中还是使用 PhoneGap 构建(即调试和发布).
  • 无论是在 iOS(使用 Safari 的开发工具)还是 Android(使用 Chrome 的开发工具)中,控制台中都没有缺少资源的例外.
  • 我已经完成了与我最后一个已知的工作版本的差异,而且真的什么都没有弹出.我看到了一个未定义的 Underscore 引用,但我取消了该更改,但它没有解决任何问题——我想无论如何我都会在控制台中看到异常.
  • CLI: Cordova 6.1.1, android 5.1.1, ios 4.1.1
  • I'm not using any special plugins to display a splash screen -- just <splash> elements in my config.xml file.
  • This is happening in both iOS and Android, both on local builds and using PhoneGap Build (i.e., debug and release).
  • There are no exceptions of missing resources in the console, either in iOS (using Safari's dev tools) or Android (using Chrome's dev tools).
  • I've done a diff with my last known working build, and there's really nothing that pops out. I saw an undefined Underscore reference, but I backed that change out and it didn't resolve anything -- I think I'd see the exception in the console, anyway.

Cordova/PhoneGap 最近是否做了一些可能导致这种情况的事情?关于如何隔离这个的任何想法?我真的被难住了.

Has Cordova / PhoneGap done something recently that might be causing this? Any ideas on how to isolate this one? I'm really stumped.

推荐答案

那太丑了.结果是, 抛出了一个异常,只是被浏览器开发工具(Safari、Chrome for iOS 和 Android)发现的太早了.当我通过浏览器目标(cordova platform add browser 等)运行时确实出现了异常,所以我猜浏览器平台对某些东西很有用.:-)

Well that was ugly. It turned out that there was an exception being thrown, it was just being thrown too early for the browser dev tools to pick it up (Safari, Chrome for iOS and Android, respectively). The exception did show up when I ran things through the browser target (cordova platform add browser, etc.) So that browser platform is useful for something I guess. :-)

在我的例子中,cordova-sqlite-storage 插件做了一个破坏性的 API 更改,当我更新所有内容时破坏了代码.解决方案是将插件固定到 config.xml 文件中的早期版本.

In my case, the cordova-sqlite-storage plugin had made a breaking API change that broke the code when I updated everything. The solution was to pin the plugin to an earlier version in the config.xml file.

所以,吸取教训:

  • 如果您怀疑启动过程中抛出了异常,您可以使用浏览器平台进行跟踪.
  • 使用 config.xml 中的 spec 参数将您的插件固定到特定版本.这将在未来为您省去一些心痛.
  • [下面来自@jcesarmobile 的另一个选项] 在浏览器开发工具中点击刷新也将排除异常.好的!
  • If you suspect there's an exception being thrown during startup, you can use the browser platform to track it down.
  • Pin your plugins to a specific version using the spec parameter in the config.xml. This will save you some heartache in the future.
  • [another option from @jcesarmobile, below] hitting refresh in the browser dev tools will also kick out the exception. Nice!

我将返回到 config.xml 并固定其他项目 - 并按照上面的建议进行一些清理.再次感谢大家.

I'll be going back in to the config.xml and pinning the other items -- and doing some cleanup as suggested above. Thanks again, everyone.

这篇关于Cordova - 启动后出现白屏,控制台中没有异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆