title: PhoneGap Developer App not loading plugin
body: <p>I'm trying to test barcode scanner in a very simple phone gap app.  I'm trying to test the app in PhoneGap Developer App.  I've been following a bunch of different solutions I've found while googling:</p>
  
  <p><a href="http://www.raymondcamden.com/2014/3/5/Barcode-Scanner-sample-and-new-repo-for-Cordova-examples" rel="nofollow noreferrer">http://www.raymondcamden.com/2014/3/5/Barcode-Scanner-sample-and-new-repo-for-Cordova-examples</a></p>
  
  <p><a href="https://stackoverflow.com/a/19591607/418549">https://stackoverflow.com/a/19591607/418549</a></p>
  
  <p>Here's my HTML:</p>
  
  <pre><code>        &lt;div class="app"&gt;
          &lt;h1&gt;PhoneGap&lt;/h1&gt;
          &lt;div id="deviceready" class="blink"&gt;
              &lt;p class="event listening"&gt;Connecting to Device&lt;/p&gt;
              &lt;p class="event received"&gt;Device is Ready&lt;/p&gt;
          &lt;/div&gt;
          &lt;p&gt;&lt;/p&gt;
          &lt;p&gt;&lt;/p&gt;
          &lt;button id="startScan"&gt;Start Scan&lt;/button&gt;
          &lt;div id="results"&gt;&lt;/div&gt;
      &lt;/div&gt;
      &lt;script type="text/javascript" src="cordova.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="js/barcodescanner.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="js/index.js"&gt;&lt;/script&gt;
  
      &lt;script type="text/javascript"&gt;
          app.initialize();
      &lt;/script&gt;
  </code></pre>
  
  <p>Here's my initialize code:</p>
  
  <pre><code>var resultDiv;
  
  var app =
  {
  // Application Constructor
  initialize: function ()
  {
      this.bindEvents();
  },
  
  bindEvents: function ()
  {
      document.addEventListener('deviceready', this.onDeviceReady, false);
  },
  
  onDeviceReady: function ()
  {
      app.receivedEvent('deviceready');
  
      document.querySelector("#startScan").addEventListener("touchend", startScan, false);
      resultDiv = document.querySelector("#results");
  },
  
  receivedEvent: function (id)
  {
      var parentElement = document.getElementById(id);
      var listeningElement = parentElement.querySelector('.listening');
      var receivedElement = parentElement.querySelector('.received');
  
      listeningElement.setAttribute('style', 'display:none;');
      receivedElement.setAttribute('style', 'display:block;');
  
      console.log('Received Event: ' + id);
  }
     };
  function startScan()
  
  {
      try
      {
          var scanner = cordova.require("com.phonegap.plugins.barcodescanner.BarcodeScanner");
          //var scanner = cordova.require("cordova/plugin/BarcodeScanner");
  
          scanner.scan(
              function (result)
              {
                  var s = "Result: " + result.text + "&lt;br/&gt;" +
                  "Format: " + result.format + "&lt;br/&gt;" +
                  "Cancelled: " + result.cancelled;
                  resultDiv.innerHTML = s;
              },
              function (error)
              {
                  alert("Scanning failed: " + error);
              }
          );
      }
      catch (e)
      {
          console.log('-------------------------- ERROR 1');
          console.log(e);
      }
  }
  </code></pre>
  
  <p>When running this code in PhoneGap Build App, I always get 'module com.phonegap.plugins.barcodescanner.BarcodeScanner not found' error message.  I think the problem is the Java file is not getting loaded.</p>
  
  <p>PhoneGap Developer App is pointing to the root www folder.  Should it be pointing to the www folder for Android instead?</p>
  
  <p>Thanks</p>
  
  <p>Tom</p>