如何解决 Android webview 崩溃的问题(由于丰富的 JS/交互)?
我使用的是 Droid X,运行 Android 2.2。我是一名客户端网络开发人员。
我有一些丰富的功能(ajax 调用、微调器、dom 访问以重新注入结果)。
交互导致 webview 崩溃。它不会在其他 Android 设备上崩溃(至少是我测试过的设备)。它在 iPhone 或 iPad 上也不会崩溃。
事实证明,具体隔离 JavaScript 的哪一部分导致 webview 崩溃(我假设是 JS)是非常困难的。
有人可以告诉我如何有效地解决这个问题,以便我修补我的代码,这样网络视图就不会崩溃吗?
谢谢。
I'm using a Droid X, running Android 2.2. I am a client side web dev.
I have some rich functionality (ajax call, spinner, dom access to reinject results).
On of the interactions makes the webview crash. It is not crashing on other android devices (the ones I've tested at least). It also doesn't crash on iPhone or iPad.
Isolating specifically what part of the JavaScript is crashing the webview (I assume it's the JS) is proving to be very difficult.
Anybody have tips on how I can effectively troubleshoot this so I patch my code so the webview won't crash?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
回答:我发现没有一个简单的方法。我只需要尝试尽可能地隔离代码。保持 JS 解耦和模块化是一个好主意,这样您就可以取出其中的一部分,然后运行页面而不会导致到处错误。这也使得解决上述问题变得更加容易。
Answer: There isn't an easy way that I found. I just had to try to isolate the code as much as possible. It's a good idea to keep the JS decoupled and modular so you can pull out 1 piece, and then run the page without causing errors all over the place. This makes troubleshooting issues like the one above much easier as well.