0

I am new in phonegap. For creating application, I installed :

  • phonegap desktop
  • phonegap developer app
  • created app in framework7 template using "phonegap desktop"

I was able to install social sharing plugin successfully.

Now, I want to install "cordova-plugin-app-version"(https://github.com/whiteoctober/cordova-plugin-app-version)

i did as per instruction but plugin is not working.

On installing plugin folder created in plugins folder. My question is, it is need to copy all required files to "platforms" folder?

Chris Neve
  • 2,164
  • 2
  • 20
  • 33

2 Answers2

1

When you install the plugin, Cordova will install it in the plugins directory.

You need to build your application, then Cordova will update each platform with the changes you have made to the project.

Build or run your project, and then you will find the new plugin in the platforms directory (platforms//plugins).

cordova run android
Chris Neve
  • 2,164
  • 2
  • 20
  • 33
1

If you have already added the platform before installing the plugin, the plugin installation should happen automatically in all platforms while adding the plugin in Cordova CLI using following command:

cordova plugin add PLUGIN_NAME

If it does not happen for some reason, you may remove and re-add the platform once to resolve this in cordova CLI using following commands:

cordova platform rm PLATFORM_NAME

cordova platform add PLATFORM_NAME

Community
  • 1
  • 1
Gandhi
  • 11,875
  • 4
  • 39
  • 63
  • "platforms" folder contains only "browser" directory and "platforms.json" file. so, i added android using this command: cordova platform add android and got the below error: https://www.screencast.com/t/pPcojiJn – Kirti Umrigar Jan 23 '17 at 10:06
  • @KirtiUmrigar Please check out this link to resolve the above error - http://stackoverflow.com/questions/41394419/while-making-build-in-cordova-using-cmd/41394914#41394914 Do upvote answers if they were useful. – Gandhi Jan 23 '17 at 10:25
  • I have already tried that, but not working. i read in comment about adding "java bin path ", so i am confused, is it necessary too? – Kirti Umrigar Jan 23 '17 at 10:40
  • @KirtiUmrigar Setting java options is enough. In path variable, u can add your java instalaltion path but that dont through up this error. Also try each time on new command prompt – Gandhi Jan 23 '17 at 10:43
  • ok. thank you @Gandhi :). Setting java options, and restart pc and it is working. able to add android in platforms folder. able to add plugin. thanks. but unfortunately plugin is not working. – Kirti Umrigar Jan 23 '17 at 11:46
  • @KirtiUmrigar You can post what exactly is not working in plugin as a different question with more info on the same. Also please close this question by accepting my answer if it was helpful. Cheers Kirti – Gandhi Jan 23 '17 at 11:49
  • ok. :) but i wanted to know, it is required to add ios and android folders in platforms? because created folder contains so many files and folders. while in some plugin instruction they mentioned to create folder structure and and have only one file in it. – Kirti Umrigar Jan 23 '17 at 12:55
  • @KirtiUmrigar if you are testing on android you need to add and build android platform and for iphones devices you gotta add and build ios platform – Gandhi Jan 23 '17 at 15:55