0

How can I successfully import and convert an Ionic project to a Visual Studio Multi Device Hybrid App project???? I've copied all the files inside www folder to VS project root directory but It keeps showing errors with this plugin "com.ionic.keyboard".

I believe it's not been recognized by Visual Studio. So how can add this plugin to Visual Studio? This is the error when I debug in Ripple:

$ionicPlatform.ready(function() { // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard // for form inputs) if(window.cordova && window.cordova.plugins.Keyboard) { cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true); //ERROR HERE } if(window.StatusBar) { // org.apache.cordova.statusbar required StatusBar.styleDefault(); } }); })

This is the error message: Cannot read property 'Keyboard' of undefined

thiago
  • 377
  • 5
  • 20

1 Answers1

0

Your app cannot run without the plugins, and if you just copy the www directory the plugins are not in the project. You might need to copy the entire project instead of just the www directory, or look at the documentation about how to add plugins.

You could remove the run() method from the app.js file which is trying to use the plugins which don't exist in your project, or if you plan on using Cordova plugins you will want to review the documentation on how to add them into your project http://msdn.microsoft.com/en-us/library/dn757051.aspx.

You then will need to setup your platforms http://msdn.microsoft.com/en-us/library/dn757049.aspx.

I don't know much about Visual Studio, but it uses Cordova. You might find this link handy, which has an AngularJS app sample, which Ionic is very similar because it also uses Angular. https://code.msdn.microsoft.com/AngularJS-TODO-Sample-for-b651512a/

Jeremy Wilken
  • 6,965
  • 22
  • 21