0

I am following the aerogear tutorial on https://aerogear.org/docs/guides/aerogear-cordova/AerogearCordovaPush/.

I have gone through this several times now and continue to have the same issue.

When deploying to Genymotion, and debugging using chrome, I see the following error:

file:///android_asset/www/plugins/aerogear-cordova-push/www/aerogear-push.js Failed to load resource: net::ERR_FILE_NOT_FOUND
file:///android_asset/www/plugins/aerogear-cordova-push/www/aerogear.ajax.js Failed to load resource: net::ERR_FILE_NOT_FOUND
cordova.js:1431 Uncaught Error: Module aerogear-cordova-push.AeroGear.ajax does not exist.
cordova.js:1185 deviceready has not fired after 5 seconds.
cordova.js:1178 Channel not fired: onPluginsReady
cordova.js:1178 Channel not fired: onCordovaReady

Observations

I notice that, when viewing in the Chrome inspector, that the plugin files are empty plugin files are empty, yet in my local project there is contents for all the plugin files.

Things I have tried

  • Removing and re-adding aerogear plugs
  • Doing a factory reset of the Genymotion vm.
  • Uninstall and reinstall node using instructions on Installing NodeJS without sudo in Ubuntu
  • Reinstall cordova
  • Reinstall genymotion
  • Restart

Details

  • Node version v5.4.1
  • Ubuntu version 15.10
  • Cordova 5.4.1
  • Android 5.1

Does anyone know how to fix this?

Thanks

Community
  • 1
  • 1
Magick
  • 4,603
  • 22
  • 66
  • 103
  • It appears that AeroGear plugin is not installed properly at the first glance what does your console say when you enter the "cordova plugin add" - command? Did you also try to add/install it locally(via download and referencing it via filesystem)? – Blauharley Jan 23 '16 at 11:25
  • @Blauharley - Ive tried installing the plugin using both 'cordova plugin add https://github.com/aerogear/aerogear-pushplugin-cordova.git' and 'cordova plugin add org.jboss.aerogear.cordova.push'. Same result. 'cordova plugin add org.jboss.aerogear.cordova.push Notice: org.jboss.aerogear.cordova.push has been automatically converted to aerogear-cordova-push and fetched from npm. This is due to our old plugins registry shutting down. Fetching plugin "aerogear-cordova-push" via npm Plugin "aerogear-cordova-push" already installed on android. – Magick Jan 23 '16 at 11:46
  • I just built a default android project and then installing aerogear-cordova-push plugin via "cordova plugin add https://github.com/aerogear/aerogear-pushplugin-cordova.git" because the first one did not find this plugin in the cordova registry. I did not set up the whole push-functionality via googel for android but there are "aerogear-push.js" and "aerogear.ajax.js" files. My cordova version is 5.3.1. May be there is another problem why this plugin is not installed properly so I would suggest to update your dev-environment first and try to setup/run a default project. Good luck! – Blauharley Jan 23 '16 at 12:06
  • I also see the "aerogear-push.js" and "aerogear.ajax.js" files locally. Were you able to run your app without this error? – Magick Jan 23 '16 at 12:23
  • Basically yes, I was able to call push.register after deviceready has been fired. Are there really these two files within your platform/andriod directory? because your error logs say no. – Blauharley Jan 23 '16 at 12:46
  • Yes, in my local project I can see these files. Here is my [project structure](http://i.imgur.com/mEvxxi9.png). However, Im not sure if they get deployed. – Magick Jan 23 '16 at 13:15
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/101469/discussion-between-magick-and-blauharley). – Magick Jan 23 '16 at 14:33
  • seems you have fixed your issue: http://aerogear-users.1116366.n5.nabble.com/Aerogear-users-Failed-to-load-resource-tp487p491.html – lholmquist Jan 25 '16 at 14:03

1 Answers1

0

I cannot say for sure why fixed it, but I suspect it was due to either:

  • permissions
  • corrupted dependencies

After reinstalling and re-setting permissions - and doing a restart - it worked correctly.

Magick
  • 4,603
  • 22
  • 66
  • 103