Unhandled exception in WWAHost in Cordova APP using Angular

妖精的绣舞 提交于 2019-12-10 18:03:09

问题


I'm currently developing a windows modern app using Foundation for Apps and cordova. The app crashes in many ways during navigation, sometimes even immediately after running it.

The crash is this one

And i can't manage to debug it in any way.

I've tried setting up a window.onerror and a WinJS.Application.onerror catch all function with no results. Apparently the crash happens at a lower level. I've also inspected the event viewer but no info are available.

What happens is apparently similar to this question: How to debug unhandled win32 exception in WinJS Win8 store app which is unfortunately unsolved.

What are my options here?


回答1:


I had the same issue with Visual Studio 2015, Windows 10 and cordova 5.1.1 when I transfer the project to another dev environment. It only occurs at the Windows-x64 app build configuration for the local machine.

After successful building, the app window launches shortly and after that, the win32 exception like the screenshot from sPoz came up. It was reproducible every time.

I try to repair Visual Studio and also I checked the environment variable from my solution as it is described in this Microsoft Article. But I had no luck.

Nothing helped, but simply open the config.xml file and change the Windows Target Version from "Windows 10" to "Windows 8.1" solved the problem and I could run the app with no error:

After that I can turn back to "Windows 10" and everything is fine. This was reproducable on two dev machines.

I do not exactly know if the moved project was the source of the problem and maybe the rewritten config.xml triggers any rebuild mechanism.




回答2:


Most likely you are hitting an issue related to DOM Ex WWAHost.exe error on Windows 8.1 (apparently fixed on Win10). There is a workaround that should work for most apps; before you click around and get the WWAHost.exe exception, close the DOM Explorer window. This should enable you to debug by hitting breakpoints, etc. If you need to use DOM Ex against a Windows target, you might need try debugging against a remote device (see Kenneth's suggestion here: Why is Cordova Windows 8 app causing an unhandled win32 exception occurred in wwahost.exe?)




回答3:


What are you using to develop the app ? The Visual Studio Tools for Apache Cordova ? Or Cordova with CLI ? If you are using the plugin, you must launch the generated WP project to debug. The debug of WP app is not supported currently with the plugin.




回答4:


I was getting same error during development of cordova windows tablet application, using Visual Studio Enterprise 2015. So far, I was doing try to close DOM-Explorer and use breakpoints and javascript console. After that, while searching javascript intellisense issues with Visual Studio, I figured out that my problem was fixed. What I did to get rid of this problem is that:

  • Open Tools > Options
  • Select Text Editor > Javascript > Intellisense > References
  • Add following references ( angular.intellisense.js, domWeb.js, domWindows_8.1.js ).

I don't know what are the correct reference files, but with these 3 reference files added, my problem has been solved.



来源:https://stackoverflow.com/questions/29851663/unhandled-exception-in-wwahost-in-cordova-app-using-angular

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!