I am trying to debug what the cordova_plugins.json file is used for?
I am using multiple plugins so far and I have never interacted with this file. I want to figure out why cordova makes an xhr request for this file at initialization.
When looking at my console I keep seeing this 404 error every time I test my app in Chrome and like to understand why this file is necessary.
That file did represent a bug/loose end in previous versions of Cordova/PhoneGap - and nurieta's suggested fix did resolve the (harmless) error thrown in its absence. The successor to this file is now created and handled by the Cordova/PhoneGap CLI entirely and resides in /myapp/platforms/#platform#/www/cordova_plugins.js
Bottom line - though the file sorta exists still this is no longer an issue as of Cordova 3.0.
It seems this is a know issue as discussed: here
Creating a dummy json file did not solved the problem for me... Indeed, remove this entire chunk of code at the end of cordova-2.7.0.js
and replace it with a call to finishPluginLoading() will solve the problem.
I actually mock this file as an empty json file whose content is : "{}" and -using cordova 2.6- that seems to fix issues. There was not an ugly 404 and cordova seemed to work fine.
Edit: You can delete the code that does the ajax request all together from cordova and things would work just fine.
It seems like a feature introduced in Cordova 2.6.0, at least I just noticed in this version. At this point I could not find any documentation and I don't have many details on it, but right now I solved the 404 issue adding a dummy cordova_plugins.json file to the root of my project.
As it expects a valid json file I added the following content to the file: "just a dummy file required by Cordova 2.6.0"
Filip Maj of Adobe has said elsewhere that this is due to (so far) partially implemented plugin tooling. In future versions of Cordova, the plugin tooling will generate cordova_plugins.json itself.
For now, he has said it's save to completely ignore the 404 error. If you feel it is affecting your application, you should file a bug with Cordova.
[Note that if you add a dummy file yourself, it may affect the integration of Plugins]
i confirm francis answer and would note that on 2.7 if a dummy file is inserted, sometimes it starts an infinite loop on error "processMessage failed: invalid message:" (line cordova-2.7.0.js:971). keeping the 404 error seems indeed safer. (ref: https://groups.google.com/forum/?fromgroups#!topic/phonegap/slbvvtEw0aw)