cordova_plugins.js is missing

Guy Korland picture Guy Korland · Aug 28, 2013 · Viewed 28.5k times · Source

I keep getting the following error when I try to launch an inappbrowser:

Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:8000/cordova_plugins.js

When I look for "cordova/platforms/android/assets/www/cordova_plugins.js" the file is indeed missing.

The strange thing is that I see:

Writing out cordova_plugins.js...

My build process looks like this:

cordova create cordova com.myapp.mobile myapp
cd cordova
cordova platform add android
cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser.git
cordova build
cordova serve android

Answer

Lothre1 picture Lothre1 · Jul 4, 2018

Since I use the same environment to produce multiple apps (with different names and skins) I often run rm -rf /platform/{platform} to remove my old platform project.

To start a fresh project using my config.xml I run cordova build {platform} the project will recreate this directory and the project will compile successfully although cordova_plugins is not created in /platform/{platform}/platform_www.

To solve this issue, I started by running cordova platform add {platform}.

Then cordova prepare {platform} to copy www assets into that folder

Last but not least cordova build {plaftorm}!

Hope this helps someone facing the same issue.