Search code examples
angularjswin-universal-appwinjs

Windows Phone 10 UWP with AngularJS is randomly crashing


I have written two apps for Windows Phone 10 using WinJS with AngularJS. Versions used: AngularJS 1.4.9 (I also tried downgrading to 1.3.20) WinJS 4.4.0 Angular.WinJS 4.4.0

Now the apps work great on the emulators but keep crashing randomly on the device itself. I enabled dev mode on the device to view the crash dump. Here is what I got:

Dump File:  Ring Times - 32507DG-InfoTec.RingTimes with exception C0000194 on 3-17-2016 07.36.dmp : Ring Times - 32507DG-InfoTec.RingTimes with exception C0000194 on 3-17-2016 07.36.dmp
Last Write Time:    17.03.2016 07:36:26
Process Name:   wwahost.exe : wwahost.exe
Process Architecture:   ARM
Exception Code: 0xC0000194
Exception Information:  
Heap Information:   Present

Sadly no Exception information was given. Tried that multiple times but in every dump file the exception information was missing.

I put additional exception handling into the application catching AngularJS exceptions and writing them into a file, after that global WinJS error handling (WinJS.Application.onerror) to catch everything there and write it into a file but in both cases no files are written. Sometimes you simply open the app on a device and after 10-20 seconds the app crashes. Nothing happens in the meantime, no user interaction not background services are running nothing.

Anyone experienced same or something similar or can point me into the right direction? Any help is appreciated.


Solution

  • Ok I fixed it myself. I'm not sure what exactly caused this but I could narrow it down. Here is what I did.

    • downgraded to AngularJS version 1.3.10. I used 1.4.9 before. AngularJS-WinJS library doesn't work with version 1.5.x there is a known bug caused by the transclude directive which adds ng-transclude="true" to the elements. I don't believe it's because I downgraded but I wanted to mention it since I feel the app behaves much more stable now.
    • removed manual bootstrapping of AngularJS. What I did before in both apps was to manually bootstrap AngularJS in the onactivated event of the WinJS application. I removed all the code and added the ng-app directive to the markup.

    As I said before I don't know what exactly caused the random crashes but the above two points seemed to help out a lot. No crash since then. Hope it helps someone else