2
votes

TLDR: 'System.SystemException' occurred in Microsoft.Phone.Interop.ni.dll wp8 cordova trying to access camera

I have been trying to get a basic wp8 cordova app working for a number of days now, however I am being stumped by errors, both before any of my code is processed and within my code, the application will run with these errors however when I attempt to access native resources, namely the camera and camera roll, more errors are thrown and the calls fail, so I am trying to work through this one issue at a time, I have run through numerous tutorials and examples however I hit the same issue every time.

I am working on windows 8.1 with the latest phonegap and visual studio express 2012 for windows phone. I have all the necessary frameworks installed and am testing using the visual studio emulator and a lumia 520.

My application is the stock standard "Hello World" cordova app, built to WP8, I have then modified index.html with various example code.

I have allowed all capabilities in WMAppManifest.xml

The error I am running against is 'System.SystemException' occurred in "Microsoft.Phone.Interop.ni.dll"

This first occurs upon the application startup on line 89 in BrowserMouseHelper.cs (this is code generated by cordova and is untouched by myself)

I then also get this error whenever I try and trigger navigator.camera.getPicture

This happens in every example project I have tried and so it must be related to the environment or a configuration setting that I am not aware of.

I have spent many hours trying to find reference to this issue and have not been successful, if anyone has experience with this I would really appreciate direction.

'TaskHost.exe' (CLR C:\windows\system32\coreclr.dll: DefaultDomain): Loaded         'C:\windows\system32\mscorlib.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'TaskHost.exe' (CLR C:\windows\system32\coreclr.dll: Silverlight AppDomain): Loaded 'C:\windows\system32\System.Windows.RuntimeHost.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'TaskHost.exe' (CLR C:\windows\system32\coreclr.dll: Silverlight AppDomain): Loaded 'C:\windows\system32\System.Windows.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'TaskHost.exe' (CLR C:\windows\system32\coreclr.dll: Silverlight AppDomain): Loaded 'C:\windows\system32\System.Net.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'TaskHost.exe' (CLR C:\windows\system32\coreclr.dll: Silverlight AppDomain): Loaded 'C:\windows\system32\System.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'TaskHost.exe' (CLR C:\windows\system32\coreclr.dll: Silverlight AppDomain): Loaded 'C:\windows\system32\System.Xml.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'TaskHost.exe' (CLR C:\windows\system32\coreclr.dll: Silverlight AppDomain): Loaded 'C:\Data\Programs\{6352E5B2-FFD5-42B7-8A8E-93EAEC65B2E7}\Install\com.phonegap.helloworld.DLL'. Symbols loaded.
'TaskHost.exe' (CLR C:\windows\system32\coreclr.dll: Silverlight AppDomain): Loaded 'C:\windows\system32\Microsoft.Phone.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'TaskHost.exe' (CLR C:\windows\system32\coreclr.dll: Silverlight AppDomain): Loaded 'C:\windows\system32\Microsoft.Phone.Interop.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'TaskHost.exe' (CLR C:\windows\system32\coreclr.dll: Silverlight AppDomain): Loaded 'C:\windows\system32\System.Xml.Linq.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
'TaskHost.exe' (CLR C:\windows\system32\coreclr.dll: Silverlight AppDomain): Loaded 'C:\windows\system32\System.Core.ni.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
CordovaBrowser_LoadCompleted
A first chance exception of type 'System.SystemException' occurred in Microsoft.Phone.Interop.ni.dll
An exception of type 'System.SystemException' occurred in Microsoft.Phone.Interop.ni.dll and wasn't handled before a managed/native boundary
The thread 0xf70 has exited with code 259 (0x103).
CordovaBrowser_LoadCompleted
A first chance exception of type 'System.SystemException' occurred in Microsoft.Phone.Interop.ni.dll
1
If you find yourself with this issue you must add the plugin via the CLI to the project. Cordova has split a lot of functions into plugins that need to be installed individually, if you are learning from old tutorials or documentation you may not have come across this fact. - user3453654
I've installed my camera plugin and I'm having the same issue, even though in the CLI, npm tells me that I have already installed the plugin to the project. - Rex_C
@Rex_C have you gone through the other steps mentioned in the original post? Is the error occurring on the same line as the OP? "System.SystemException" can mean a number of things. - user3453654

1 Answers

0
votes

If you find yourself with this issue:

You must add the plugin via the command line to the project.

$ phonegap local plugin add [plugin uri]

Cordova/phonegap has separated a lot of functions into plugins. These need to be installed individually.

If you are learning from old tutorials or documentation you may not have come across this fact, I did not initially.