I had created a CLI project, and then used CLI to add the android platform and add many plugins, etc.
Then I used cordova prepare to copy my "common" www files to the android platform folders. This step worked OK for the simple HelloWorld example from the CLI online guide, but for my full CLI project the prepare did not copy anything. The prepare processed the plugins OK, but nothing copied, and there was no error or any other indication what went wrong. (The -d debug flag did not help much either)
Eventually, after consuming a lot of coffee the problem was isolated to a file called android_parser.js which executes during the cordova prepare processing.
is apparently assuming that the main app java class is the only (or first?) file found in the package directory. But this assumption is incorrect for my project (e.g. there are other sub-packages which were found ahead of the .java file) and so the script was failing shortly after this line of code, resulting in no copy...
For example, my project structure resembles
To get arround this issue I am currently using using a hacky workaround - renaming the app java file with a prefix "AAA_" so that at least the zero offset can find it OK.
With this hack in place the cordova prepare copies the common files as expected.
BTW - In fact I don't even use this file at all because my AndroidManifest.xml is manually configured to launch a completely different main activity. But I have to leave this dummy AAA_MyApp.java file lying around just so the CLI cordova prepare will behave properly. If not for this issue then I would just delete it.