Search code examples
visual-studiocordovacordova-pluginsvisual-studio-cordovaopentok

Apache Cordova For Visual Studio Crashes VS When Importing Certain Plugins


Edit: I was able to import a plugin from GitHub (Auth0) in VS successfully. The problem seems to be in the parsing of certain plugins like one I'm really trying to install which is the latest version of OpenTok for Cordova. The latest version is only on GitHub so I'm stuck with this crashing.

Whether you've installed Cordova into Visual Studio 2013 (SP4) or are using Visual Studio 2015 Preview which comes with Apache Cordova VS will crash when you try to import certain custom Cordova plugin to your project. You can replicate this issue by creating a Cordova project, right clicking confix.xml -> View Designer -> Plugins -> Custom. When trying to import from Github or downloading and importing locally neither works. Visual Studio will crash for example when inputting https://github.com/songz/cordova-plugin-opentok or the URL of the .git with the same error as in this screenshot:

Error Before Crash

The error reported when the opentok crash happens is:


Problem signature:

Problem Event Name: CLR20r3

Problem Signature 01: devenv.exe

Problem Signature 02: 14.0.22310.1

Problem Signature 03: 546094b0

Problem Signature 04: mscorlib

Problem Signature 05: 4.5.27.0

Problem Signature 06: 545ca51f

Problem Signature 07: 48dd

Problem Signature 08: 27

Problem Signature 09: System.ArgumentNullException

OS Version: 6.3.9600.2.0.0.256.48

Locale ID: 1033

Additional Information 1: 5861

Additional Information 2: 5861822e1919d7c014bbb064c64908b2

Additional Information 3: a10f

Additional Information 4: a10ff7d2bb2516fdc753f9c34fc3b069


Visual Studio will then crash and the plugin never gets added. The only plugins you can add are the ones in the "Core" list within VS. I've also tried installing them from the command line first navigating to the project's directory (Not the folder with the sln file of course, the folder below that with all the project files) and it says that it's not a Cordova project. I've also tried manually downloading the plugin and adding it a directory that I've added to the solution and then importing but that didn't work.

If I knew how to manually use the plugin by importing all the files and referencing them somewhere in my Cordova project as javascript or xml references I would but I wouldn't know how to do that (If that's even a solution that would work for compiling to Android and IOS and I have tried).

This is a big problem and it's devastating me because I really want to use Cordova and this is my first experience. I want to use VS because it's a great environment to develop and test/emulate in and Cordova doesn't come an IDE or the same emulators. I don't know of any other IDE to develop Cordova in where I can import plugins and preview my apps like in VS (They use special emulators that don't require the use of the Android SDK emulators).

Any help would be greatly appreciated. I have no idea what to do. I've submitted bug reports here: https://github.com/songz/cordova-plugin-opentok/issues/137 here: https://github.com/alongubkin/phonertc/issues/123 and here: https://issues.apache.org/jira/browse/CB-8279 . Don't know how that will turn out. I've also tried updating Web Essentials in VS2013 but that didn't work either.

Thanks for anything you can think of.


Solution

  • The plugin.xml file doesn't validate which I've submitted a pull request to fix. If you download the plugin and update the file yourself, you should be able to add it from disk by browsing to the location.