Search code examples
javascriptcordovauwpwindows-10-mobile

Cordova/UWP Windows Mobile 10 Access Violation on HTML select element


In Visual Studio 2015 Update 3, I have created a JavaScript -> Windows -> Windows 8 -> Windows Phone -> Blank App (Windows Phone) project. I then changed the default.html to include a <select> element like this:

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>App1</title>

    <!-- WinJS references -->
    <!-- At runtime, ui-themed.css resolves to ui-themed.theme-light.css or ui-themed.theme-dark.css 
    based on the user’s theme setting. This is part of the MRT resource loading functionality. -->
    <link href="/css/ui-themed.css" rel="stylesheet" />
    <script src="//Microsoft.Phone.WinJS.2.1/js/base.js"></script>
    <script src="//Microsoft.Phone.WinJS.2.1/js/ui.js"></script>

    <!-- App1 references -->
    <link href="/css/default.css" rel="stylesheet" />
    <script src="/js/default.js"></script>
</head>
<body class="phone">
    <select>
        <option>Val</option>
        <option>Val</option>
        <option>Val</option>
        <option>Val</option>
    </select>
</body>
</html>

When tapping on the select element, the application crashes on Windows Mobile 10 with:

'WWAHost.exe' (Script): Loaded 'Script Code (MSAppHost/2.0)'. 
The program '[3976] WWAHost.exe' has exited with code -1073741819 (0xc0000005) 'Access violation'.

This happens on devices and the Windows Mobile 10 emulator. Windows Phone 8 does not seem to have this problem. Until recently, this worked fine on Windows Mobile 10 as well. Perhaps an update caused this? Interestingly, Cordova and UWP are also affected. Is there a known solution yet?


Solution

  • I am experiencing the same issue. I don't have a fix but I can at least explain what I have found.

    • I tried using WinJS 2.1 and WinJS 4.4
    • The select element works just fine on Windows Phone 8.1 and Windows 10 (Desktop)
    • Edit #1: I have now tried doing a full reset on my phone and installing everything from scratch again - it would appear that it pulls in the latest update when you do a reset - so this didn't help at all.
    • Edit #3: I tried setting all different kinds of listeners (onclick, onchange, onmouseover, etc) and none of them ever fire. The crash happens before these events.
    • Edit #3: I tried completely restyling the select element with CSS. No luck.

    It seems like we both discovered this issue right around the same time. This would lead me to believe that this has been caused by a recent update. Hopefully there will be another update soon to fix the problem.

    I sent an email to MS support asking for more information, I will let you know if I find more. I was trying to think of alternates to use instead of a select element - but I really couldn't come up with an easy solution. I am at least going to wait a while before I have to rewrite all of my select elements.

    I know this doesn't help much but I will be sure to update my answer if I find anything!

    EDIT #2: Here is the crash dump straight from the phone.

    EDIT #4: MS support basically blew me off and told me to go post the problem in their technical forums. Feel free to check out my post (hopefully get it more traction) or post your own thread.


    EDIT #5: I have officially given up on looking for a work around. It is broken and I (nor anyone I have seen) has been able to get around the issue. I had to replace all the elements to drill off into a new screen with a ListView. It's upsetting that we have to reinvent the wheel to achieve something so simple.