Cordova - 白屏后飞溅,控制台中没有例外 [英] Cordova - white screen after splash, no exceptions in console

查看:354
本文介绍了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, 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,分别为iOS和Android的Chrome)。当我通过浏览器目标( cordova平台添加浏览器等)运行东西时,出现了异常。因此,浏览器平台是有用的东西,我猜。 : - )

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存储插件做了一个突破性的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天全站免登陆