4 Replies Latest reply on Jul 13, 2017 7:21 AM by mikeb54063028

    cordova.plugins is always undefined

    mikeb54063028

      I'm using phonegap build and on android cordova.plugins is always undefined. I've moved my code to the device ready event, which is firing correctly. If I log cordova, it's there. But if I log cordova.plugins or cordova.file or FileTransfer, they are always undefined.

       

      snippet from config.xml

       

          <preference name="orientation" value="portrait" />

          <content src="index.html" />

          <plugin name="cordova-plugin-whitelist" spec="~1.3.2" />

          <plugin name="cordova-plugin-file-transfer" spec="~1.6.3" />

          <icon src="icon.png" />

          <access origin="*" />

          <allow-intent href="http://*/*" />

          <allow-intent href="https://*/*" />

          <allow-intent href="tel:*" />

          <allow-intent href="sms:*" />

          <allow-intent href="mailto:*" />

          <allow-intent href="geo:*" />

       

       

      snippet from www/js/index.js

       

      document.addEventListener("deviceready", function(){

       

      console.log('In Device Ready');

          console.log('woke up');

          console.log('Cordova?', cordova);

      console.log('Cordova File?', cordova.file);

      console.log('Cordova Plugins?', cordova.plugins);

      }, false);

       

      Any ideas on how else to debug this?