Ios - cordova_plugins.js not found


#1

Hey Ionic Devs

I’ve recently updated my ionic dev environment to the latest node, ionic, cordova and cordova platform versions. My environment is now as follows.

Your system information:

Cordova CLI: 5.4.0
Gulp version: CLI version 3.9.0
Gulp local: Local version 3.9.0
Ionic Version: 1.1.0
Ionic CLI Version: 1.7.12
Ionic App Lib Version: 0.6.5
ios-deploy version: 1.8.3
ios-sim version: 5.0.6
OS: Mac OS X El Capitan
Node Version: v5.4.0
Xcode version: Xcode 7.2 Build version 7C68

I can build my ios app and push to a device, but when the app loads it 404’s on the cordova_plugins.js file. After some research, it seems this file should be generated by ionic/cordova and found next to the cordova.js file.

Any help is greatly appreciated!


#2

For anyone having this issue in the future, I managed to fix it by removing a phonegap plugin that somehow made its way into my project. The plugin was phonegap-mobile-accessibility. I then had to remove the platform and then re-add the platform so the cordova_plugins.js file was re-populated with the plugin info.


#3

I am having the exact same issue, and have been digging pretty deep to find and answer. The problem we are having seems to only be on particular iphones, and is to do with this code from cordova.js:

// Tries to load all plugins' js-modules. // This is an async process, but onDeviceReady is blocked on onPluginsReady. // onPluginsReady is fired when there are no plugins to load, or they are all done. exports.load = function(callback) { var pathPrefix = findCordovaPath(); if (pathPrefix === null) { console.log('Could not find cordova.js script tag. Plugin loading may fail.'); pathPrefix = ''; } injectIfNecessary('cordova/plugin_list', pathPrefix + 'cordova_plugins.js', function() { var moduleList = require("cordova/plugin_list"); handlePluginsObject(pathPrefix, moduleList, callback); }, callback); };

Basically, for some unknown reason, cordova_plugins.js cannot be found. If the app is refreshed from a safari inspector though, it is found. It could be from a faulty plugin (not sure how), or something weird to do with the iphone file system and web views. I could be off the mark in both cases though. Would love to hear any other ideas.


#4

In my case the file was not generated at all so it 404’d when the app run. I haven’t come across the issue where the file exists but 404’s until a refresh. Hopefully you can get it fixed!


#5

Anyone have found any solution for this?
I have updated code base to match latest changes required.

Cordova CLI: 6.0.0
Ionic Framework Version: 2.0.0-beta.4
Ionic CLI Version: 2.0.0-beta.24
Ionic App Lib Version: 2.0.0-beta.14
ios-deploy version: 1.8.5
ios-sim version: 5.0.8
OS: Mac OS X El Capitan
Node Version: v4.3.1
Xcode version: Xcode 7.3 Build version 7D175

Please do share if you have any solution.