Sorry guys if this is a simple question, which I'm hoping it is. The PhoneGap/Cordova documentation is pretty bad.
So with the directory structure:
/platforms/
/ios/
/android/
/plugins/
/www/
Is there anyway to make changes in the parent plugin directory and then have it apply those changes to the different platforms? I'm doing:
cordova prepare
This updates all the HTML from the parent www
directory, but my plugins don't seem to get updated.
Hopefully someone can chime in with and give me a "doh!" moment.
A plugin is a package of injected code that allows the Cordova webview within which the app renders to communicate with the native platform on which it runs. Plugins provide access to device and platform functionality that is ordinarily unavailable to web-based apps.
I'm asking myself this question for a long time, and finally did a little script to make sure everything is up to date:
rm -rf -- platforms/*/
rm -rf platforms/platforms.json
rm -rf -- plugins/*/
rm -rf -- plugins/android.json
rm -rf -- plugins/ios.json
rm -rf -- plugins/fetch.json
cordova prepare
Have not found anything better yet
I ran into the same issue. The only way I could consistently get my plugin to update would be to uninstall the plugin completely and reinstall it from scratch.
cordova plugin rm org.apache.cordova.plugin.example
cordova plugin add ../example-app-plugin/
In this example I am installing it from a local directory.
Try:
cordova plugin add ../example-app-plugin/ --link
This will work if you are not adding or removing files from your config.xml - in which case, rm/add seem to be the way to go. So if your file structure is pretty much settled, that should get the job done for you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With