title: Phonegap/Cordova BarcodeScanner cordova.plugins undefined
body: <p>Edit: What's with the down vote? My question was well-researched and I don't believe that I deserved it.</p>
  
  <p>I know that there are several questions addressing <code>cordova.plugins</code> being undefined, but I've been unable to find a resolution with all my research.</p>
  
  <p>I'm targeting only the Android platform.</p>
  
  <p>I'm trying to use the phonegap barcodescanner plugin and am consistently running into errors trying to use it. I always get the error: <code>Cannot read property 'barcodeScanner' of undefined</code></p>
  
  <p>Setup information:</p>
  
  <ul>
  <li>Phonegap version: <code>3.5.0-0.20.4</code>
  <ul>
  <li>Not using phonegap build</li>
  </ul></li>
  <li>Cordova version: <code>3.5.0-0.2.6</code></li>
  <li>Installed plugin using all of the following methods (independently, of course, for testing) 
  <ul>
  <li>Instructions here <a href="https://github.com/wildabeast/BarcodeScanner/tree/master/src/android" rel="nofollow">https://github.com/wildabeast/BarcodeScanner/tree/master/src/android</a></li>
  <li><code>cordova plugins add https://github.com/wildabeast/BarcodeScanner.git</code></li>
  <li><code>phonegap plugin add https://github.com/wildabeast/BarcodeScanner.git</code></li>
  <li>Also tried substituting <code>http://github.com/phonegap-build/BarcodeScanner.git</code> for the wildabeast version</li>
  </ul></li>
  </ul>
  
  <p>From what I can tell, the plugin installs correctly.</p>
  
  <p>I've used 3 different methods to test what I'm doing: Browser (primarily Chrome), Ripple Chrome Extension, and the Phonegap Developer App. I get the error in the browser and Ripple, but nothing happens at all in the Phonegap Developer App.</p>
  
  <p>The code is very simple.</p>
  
  <p>The page it's being called from: </p>
  
  <pre><code>&lt;div ng-controller="StorageMainCtrl"&gt;
  
    &lt;p ng-click="doScan()"&gt;Scan!&lt;/p&gt;
  
  &lt;/div&gt;
  </code></pre>
  
  <p>The controller code handling the scan:</p>
  
  <pre><code>$scope.doScan = function() {
    cordova.plugins.barcodeScanner.scan(
      function (result) {
        var s = "Result: " + result.text + "&lt;br/&gt;" +
          "Format: " + result.format + "&lt;br/&gt;" +
          "Cancelled: " + result.cancelled;
          alert(s);
      },
      function (error) {
        alert("Scanning failed: " + error);
      }
    );
  };
  </code></pre>