Search code examples
cordovacordova-cli

Cordova/PhoneGap CLI "prepare" removes platform assets added by "plagman"


When I install an Android specific plugin using plugman it adds asset files to platforms/android/asstes/www/ which is cleared on every cordova prepare cli command and I have to manually add them back.

Is there any way to make plugman to copy them to merges/android/ or platforms/android/platform_www/ instead so that I don't need to copy them manually after every prepare?


Solution

  • Unless you have very specific needs (you don't want to use the CLI at all, or you need a bugfix or feature in a version of plugman that is incompatible with your version of cordova CLI), the best way to install all plugins in cordova is via the CLI:

    cordova plugin add https://github.com/phonegap/phonegap-plugin-fast-canvas
    

    The CLI uses plugman under the covers, but handles different asset directories, etc.

    You can install plugins that are android only or ios only with cordova plugins.