PhoneGap应用在WP8.1上崩溃 [英] PhoneGap app crashes on WP8.1

查看:69
本文介绍了PhoneGap应用在WP8.1上崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

tl; dr -我似乎无法让PhoneGap应用程序在WP8.1上成功运行.我的问题诊断过程中存在很多问题.

tl;dr - I can't seem to get a PhoneGap app to run successfully on WP8.1. There are a number of problems in my process of diagnosing the issue.

设置:我创建了一个PhoneGap 3.4 Windows Phone应用程序,并使用Visual Studio 2012 for WP在Windows Phone 8上对其进行了测试,然后提交了它.我从使用Windows Phone 8.1的用户那里获得了大量崩溃报告.

Setting: I created a PhoneGap 3.4 Windows Phone app, tested it on Windows Phone 8 using Visual Studio 2012 for WP, and submitted it. I got loads of crash reports from people with Windows Phone 8.1.

诊断问题:我继续尝试使用Visual Studio 2013 for Windows在WP8.1模拟器上运行该应用程序.我收到以下错误:

Diagnosing the problem: I went ahead and tried to run the app on a WP8.1 emulator using Visual Studio 2013 for Windows. I get the following error:

Deployment of application to device failed.
Exception from HRESULT: 0x89721500

然后我尝试选择重定向到Windows Phone 8.1".该应用程序启动并显示启动屏幕,但随后也崩溃,并且出现以下错误:

I then try selecting "Retarget to Windows Phone 8.1". The app launches and the splash screen shows, but it then crashes as well and I get the following error:

An exception of type 'System.SystemException' occurred in Microsoft.Phone.Interop.ni.dll but was not handled in user code

Additional information: An unknown error has occurred. Error: 80020006.

If there is a handler for this exception, the program may be safely continued.

试图侧载现有的XAP:认为通过VS2013运行此应用可能会有些问题,我想我可以尝试侧载它.问题是,没有用于8.1模拟器的XapDeploy.exe,而且我似乎无法从模拟器中的Internet下载/打开应用.

Tried to sideload an existing XAP: Thinking there may just be something off in running this app via VS2013, I thought I might try sideloading it. Problem is, there isn't a XapDeploy.exe for the 8.1 emulator and I can't seem to download/open apps from the internet in the emulator.

试图弄清是什么:这些都不是非常有用的,尤其是考虑到WP8.1是新的并且使用PhoneGap的人相对较少的时候;遇到这种问题的人并不多,因此在线人数很少.我已经使用PhoneGap创建的新应用尝试了以上所有内容,没什么区别.

Trying to figure out what's what: None of this is terribly useful, especially given how new WP8.1 is and how relatively few people deal with PhoneGap; there aren't many people who have encountered this kind of an issue so there isn't much online. I've tried everything above with a fresh app created by PhoneGap, no difference.

这里的任何帮助,指向我任何方向,都将非常有用.

Any help here, pointing me in any direction, would be incredibly helpful.

一种解决方法::一种解决方法是,仅排除对8.1的支持;如果我无法解决此问题,请执行以下操作:禁止8.1版本的人下载应用程序/应用程序版本.有什么办法可以做到吗?我似乎在任何地方都找不到解决办法.

A workaround: A workaround, if I can't get this to work, is to just exclude support for 8.1; keep people with 8.1 from downloading the app/app version. Is there any way for me to do that? I can't seem to find a way for that anywhere.

推荐答案

我的项目遇到了同样的问题.如果您的项目正在异步加载多个外部文件(.html,.js等),那么我找到了解决方案.

I had the same problem with my project. If your project is asynchronously loading more than one external file (.html, .js, ...) I found a solution.

我调试了这个问题的根源,并获得了看起来更简单的cordova种子示例,并慢慢进入了我的项目状态,当我加载多个时,我看到它在cordova文件XHRHelper.cs中崩溃了.一次提交文件.

I debugged what was the root of this problem, and getting simpler cordova seed examples it seem to run, and going slowly to my project state, I saw that it crashes in the cordova file XHRHelper.cs when I load more than one file at once.

最后,我在 https://issues.apache.org/jira/browse/CB-4873 <中找到了解决方案.科尔多瓦和Windows Phone 8.1似乎存在某种错误,即当他尝试异步加载多个文件时,它会崩溃.

Finally, I found in https://issues.apache.org/jira/browse/CB-4873 the solution. There seems to be some kind of bug with cordova and Windows Phone 8.1, that when he tries to asynchronously load more than one file, it crashes.

Maris Seimanovs 上有一条评论,通过提供修改后的XHRHelper文件为我解决了该问题,从而对其进行了修复:https://gist.github.com/anonymous/5bf4d9ba9cdb5d0f3f3e

There's a comment there from Maris Seimanovs that fixed it by providing a modified XHRHelper file that has solved the issue for me: https://gist.github.com/anonymous/5bf4d9ba9cdb5d0f3f3e

请记住,您可以在platform/wp8/cordovalib/XHRHelper.cs中找到XHRHelper文件

Remember that you can find the XHRHelper file in platforms/wp8/cordovalib/XHRHelper.cs

希望它对您有帮助.

这篇关于PhoneGap应用在WP8.1上崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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