title: android phonegap SpeechRecognizer Cannot read property 'speechrecognizer
body: <p>I am integrated <a href="https://github.com/poiuytrez/SpeechRecognizer" rel="nofollow noreferrer">https://github.com/poiuytrez/SpeechRecognizer</a></p>
  
  <p>I got below error</p>
  
  <p><strong>Uncaught TypeError: Cannot read property 'speechrecognizer' of undefined at file:///android_asset/www/index.html:20</strong></p>
  
  <p>index.html</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
      &lt;html&gt;
          &lt;head&gt;
              &lt;title&gt;Speech Recognition plugin demo&lt;/title&gt;
              &lt;script type="text/javascript" src="cordova-2.2.0.js"&gt;&lt;/script&gt;
              &lt;script type="text/javascript" src="SpeechRecognizer.js"&gt;&lt;/script&gt;
          &lt;/head&gt;
          &lt;body&gt;
  
              &lt;script type="text/javascript"&gt;
  
                  function onDeviceReady(){
                      console.log("Device is ready");
                  }
  
                  function recognizeSpeech() {
                      var maxMatches = 5;
                      var promptString = "Speak now"; // optional
                      var language = "en-US";                     // optional
                      window.plugins.speechrecognizer.startRecognize(function(result){
                          alert(result);
                      }, function(errorMessage){
                          console.log("Error message: " + errorMessage);
                      }, maxMatches, promptString, language);
                  }
  
                  // Show the list of the supported languages
                  function getSupportedLanguages() {
                      window.plugins.speechrecognizer.getSupportedLanguages(function(languages){
                          // display the json array
                          alert(languages);
                      }, function(error){
                          alert("Could not retrieve the supported languages : " + error);
                      });
                  }
  
                  document.addEventListener("deviceready", onDeviceReady, true);
              &lt;/script&gt;
  
              &lt;button onclick="recognizeSpeech();"&gt;Start recognition&lt;/button&gt;
              &lt;button onclick="getSupportedLanguages();"&gt;Get Supported Languages&lt;/button&gt;
          &lt;/body&gt;
      &lt;/html&gt;
  </code></pre>
  
  <p>config.xml</p>
  
  <pre><code> &lt;?xml version="1.0" encoding="UTF-8"?&gt;
      &lt;plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android"
          id="com.phonegap.plugins.speech" version="1.0.0"&gt;
        &lt;engines&gt;
          &lt;engine name="cordova" version="&gt;=3.0.0" /&gt;
        &lt;/engines&gt;
  
        &lt;name&gt;SpeechRecognizer&lt;/name&gt;
        &lt;description&gt;Recognizes speech input&lt;/description&gt;
        &lt;license&gt;MIT&lt;/license&gt;
  
        &lt;js-module src="SpeechRecognizer.js" name="SpeechRecognizer"&gt;
          &lt;clobbers target="plugins.speechrecognizer" /&gt; 
        &lt;/js-module&gt;
  
        &lt;platform name="android"&gt;
          &lt;source-file src="SpeechRecognizer.java" target-dir="src/com/phonegap/plugins/speech" /&gt;
          &lt;source-file src="LanguageDetailsChecker.java" target-dir="src/com/phonegap/plugins/speech" /&gt;
  
          &lt;config-file target="res/xml/config.xml" parent="/*"&gt;
            &lt;feature name="SpeechRecognizer" &gt;
              &lt;param name="android-package" value="com.phonegap.plugins.speech.SpeechRecognizer"/&gt;
            &lt;/feature&gt;
          &lt;/config-file&gt;
  
        &lt;/platform&gt;
  
      &lt;/plugin&gt;
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/lfjLw.png" alt="enter image description here"></p>