locked
Windows phone 8.1 cordova app crash causing exception with Error: 80020006. RRS feed

  • Question

  • I have created a cordova app with wp8 platfrom using cordova-cli. It was running properly. Then I retarget it to wp8.1 in visual studio 2013 express. On running the app it crashes with exception " 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."

    Exception occurs in XHRHelper.cs and consoleHelper.cs at the line 

     Browser.InvokeScript("execScript", new string[] { script });

    How can I resolve it?

    • Moved by Jamles Hez Monday, August 25, 2014 11:53 AM
    Thursday, August 14, 2014 12:14 PM

Answers

  • I think there's two problems. The XHRHelper.cs problem was solved for me by replacing it with this modified version:

    https://gist.github.com/anonymous/5bf4d9ba9cdb5d0f3f3e (from http://stackoverflow.com/questions/23819485/phonegap-app-crashes-on-wp8-1)

    The consoleHelper problem seems to be because execScript is no longer supported on IE11 in favor of "eval". This is based on http://msdn.microsoft.com/en-us/library/ie/ms536420(v=vs.85).aspx.

    I replaced all occurrences of execScript with eval and everything seems to work for me now.

    • Marked as answer by Asha chauhan Monday, October 27, 2014 6:53 AM
    Friday, August 15, 2014 1:26 PM
  • Problem has been resolved by replacing

     Browser.InvokeScript("execScript", new string[] { script });

    to 

     Browser.InvokeScript("eval", new string[] { script });

    in both files.

    • Marked as answer by Asha chauhan Monday, October 27, 2014 6:53 AM
    Monday, October 27, 2014 6:53 AM

All replies

  • I have exactly the same problem. Any help would be appreciated.
    Friday, August 15, 2014 5:31 AM
  • I think there's two problems. The XHRHelper.cs problem was solved for me by replacing it with this modified version:

    https://gist.github.com/anonymous/5bf4d9ba9cdb5d0f3f3e (from http://stackoverflow.com/questions/23819485/phonegap-app-crashes-on-wp8-1)

    The consoleHelper problem seems to be because execScript is no longer supported on IE11 in favor of "eval". This is based on http://msdn.microsoft.com/en-us/library/ie/ms536420(v=vs.85).aspx.

    I replaced all occurrences of execScript with eval and everything seems to work for me now.

    • Marked as answer by Asha chauhan Monday, October 27, 2014 6:53 AM
    Friday, August 15, 2014 1:26 PM
  • Sorry for late reply..

    Exceptions had gone using these solutions but Device ready event is not firing. The logs are:  

    CordovaBrowser_LoadCompleted
    A first chance exception of type 'System.SystemException' occurred in Microsoft.Phone.Interop.ni.dll
    Error calling js to fire nativeReady event. Did you include cordova.js in your html script tag?
    A first chance exception of type 'System.SystemException' occurred in Microsoft.Phone.Interop.ni.dll
    Error calling js to add appExit funtion.
    deviceready has not fired after 5 seconds.
    Channel not fired: onNativeReady
    Channel not fired: onCordovaReady


    Sunday, August 17, 2014 2:41 PM
  • Problem has been resolved by replacing

     Browser.InvokeScript("execScript", new string[] { script });

    to 

     Browser.InvokeScript("eval", new string[] { script });

    in both files.

    • Marked as answer by Asha chauhan Monday, October 27, 2014 6:53 AM
    Monday, October 27, 2014 6:53 AM