4 Replies Latest reply on Aug 28, 2017 2:16 PM by BlueWolf_

    Missing cordova_plugins.js for Android


      I have build a decent sized Phonegap app which works fine with 'phonegap serve', but when I compile and run it to Android it shows a black screen. With Chrome webinspector I found it fails on the error "Failed to load resource: net::ERR_FILE_NOT_FOUND". It cannot load "file:///android_asset/www/cordova_plugins.js".


      I've narrowed down the steps to recreate this. At this point I can't even manage to get the blank template working. I'm using Phonegap 7.0.0. Compiling on Kubuntu 17.04.


      $ phonegap create test --template blank

      $ cd test

      $ phonegap build android

      Install .apk on my phone (android 7.0) and launch it.

      Open Chrome web inspector and I see the previously mentioned error. It causes the entire app to halt.


      Massive bug in the compiler?? None of my projects work anymore.

        • 1. Re: Missing cordova_plugins.js for Android
          surajpindoria Adobe Employee

          I don't think there is an issue. The blank template does not contain any plugins in config.xml, therefore when you build it does not generate a cordova_plugins.js file. I am seeing the same error myself. But if I switch to a project that has plugins it is generating the file correctly and runs fine on the device.

          • 2. Re: Missing cordova_plugins.js for Android
            BlueWolf_ Level 1

            Well I've been trying to figure it out. I've indeed come to the conclusion that adding plugins to the blank template makes the project work properly when compiled. However, on my original project I had a fair few plugins but for some reason no cordova_plugins.js. Even though 'phonegap plugins list' showed all the plugins I had installed. Somehow that project got broken.


            My solution was to literally start from scratch. I made a blank template, installed the plugins I wanted and moved my entire www directory over. Now it is working again and I'm happy, although slightly confused.

            • 3. Re: Missing cordova_plugins.js for Android
              surajpindoria Adobe Employee

              Weird! Couple follow up questions...

              1. Have you added the plugins you use to your config.xml file?
              2. In your project, does it work if you remove the platform, "phonegap platform rm android", and then re-add it, "phonegap platform add android"?
              • 4. Re: Missing cordova_plugins.js for Android
                BlueWolf_ Level 1

                I've actually deleted the old project (shouldn't have done that) so I can't try out new things. But I have tried those options yes.

                The config.xml had all the plugins listed I was using.

                I tried removing and adding the android platform. That did not solve the problem.


                Although worth noting with my 'blank' project, I added my plugins and then added the android platform, I noticed it was actually logging it was adding the plugins. In my broken project it did not do that.