Search code examples
cordovavisual-studio-2013ionic-frameworkcordova-pluginscordova-plugin-file

Visual studio 2013 - cordova file plugin issue


Hi I'm working on Ionic framework for mobile app development in Visual studio 2013. In config.xml I could not able to add cordova file plugin, it shows couldn't able to download plugin., so I manually installed the Plugin from Git repository. The version of the plugin added is 4.2.0 and I added the following lines of code for file creation

window.resolveLocalFileSystemURL(cordova.file.dataDirectory, function (dir) {
                console.log("got main dir", dir);
                dir.getFile("log.txt", { create: true }, function (file) {
                    console.log("got the file", file);
                    logOb = file;
                    writeLog("App started");
                });
            });

But when I try to build the solution, it throws me "couldn't install cordova file plugin" and the build fails. So I downgraded the plugin version to 1.3.1, build succeeds, but it throws "cordova.file" as undefined.

Please help me resolve this issue or if you could recommend me a different method to get around this issue, that would be great!

Thanks for the answers


Solution

  • Is there any workaround for VS2013?

    As far as I know, Tools for Apache Cordova served only as "Technique Preview" in VS2013. VS2015 is the correct official version that runs TACO. So I strongly recommend you migrating to VS2015.

    But my entire code is developed in VS2013. Is there any workaround for VS2013?

    You can follow Migrate a Cordova project to Visual Studio 2015 to migrate your entire project into VS2015.