Visual Studio 2015 Cordova Plugin Add Fail

2.8k views Asked by At

I am trying to add the below Plugin to Visual Studio 2015 Cordova Project from config.xml.

https://github.com/ffournier/cordova-plugin-mbtiles

While add VS2015 gives me an error "Visual studio was unable to parse plugin.xml ... "

But I tried some other Plugins from Git that works fine.

Can anyone advise how to resolve the issue?

Thanks in advance.

Regards.

7

There are 7 answers

3
Chuck Lantz On

Be sure to include the full Git HTTPS clone URL visible to the right when visiting a github repo. Ex: https://github.com/ffournier/cordova-plugin-mbtiles.git

HTTPS Clone URL

Omitting ".git" could be your problem. It's also possible there is an issue with this specific plugin.

In addition, Git sourced plugins will not install properly if you have not installed the Git command line tools and have them in your system path. During installation of the Git tools, select the "Use Git from the Windows Command Prompt" option or add the "bin" folder from the Git install location to your path and restart VS. (Usually "C:\Program Files (x86)\Git\bin"). Visual Studio's installer will do this for you if you allowed it to install the tools.

Finally, you can try downloading a zip of the plugin and install from the local filesystem. If that still fails, the plugin is broken and you should contact the plugin author.

0
360Airwalk On

i had the very same issue.

i fixed it by installing the pluging using "cordova plugin add xxx". then i opened the plugin.xml file of my new plugin locally in visual studio and added one line to the xml file:

xmlns:android="http://schemas.android.com/apk/res/android"

so my root node of the plugin.xml looked like this:

<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
id="cordova-plugin-barcodescanner"
version="0.7.0">

afterwards i installed the plugin within visual studio from the local directory using the config.xml and it worked.

2
diwatu On

I had the same problem. I think the real reason is the xml has some syntax issue.

The way to make it work:

1. Download the package and unpack it on local.

2. Open the plugin.xml in your Visual Studio and fix the syntax issue.

3. Open config.xml and use 'local' to load the plugin.
0
Heinrich Langehoven On

I had the same issue, in Intel XDK it worked perfectly, but in VS it thru the error. They (the plugin developers) only added "name" tag to the xml, when i copied the description,licence, keywords, repo and issue tags from another config, then it seemed to work. Try that :)

0
Muhammad Ramzan On

I was also facing this issue, On my side problem was in plugin.xml first line was empty and xml was started from second line... I just removed first empty line and problem was resolved

0
khuongduybui On

Try and put this into your plugins/fetch.json:

"com.makina.offline.mbtiles": {
    "source": {
        "type": "git",
        "url": "https://github.com/ffournier/cordova-plugin-mbtiles",
        "subdir": "."
    }
}

Then in your config.xml

<vs:plugin name="com.makina.offline.mbtiles" version="1.0.0" />
0
Aldo Costa Santos On

I just found a solution for this issue, quite simple i must say. What i did was to add it to a cordova project using "cordova plugin add" command, and then reference its plugin local to where my cordova project create it. Just work's and i din't need to fix any plugin.xml or anything else.