Home > front end >  speechrecognition does not work on android11
speechrecognition does not work on android11

Time:04-04

I'm using cordova-plugin-speechrecognition in my cordova(v11) project; it is working quite well under android10 or below devices, but not work on android11.

The android11 device says "Speech recognition service is not available on the system" when my application uses speechrecognition.

I found very similar question and answer in this site, it is,

question: speech recognition service is not available on system on Android 11 Beta

answer: Adding next code in AndroidManifest.xml

 <queries>
     <intent>
       <action 
        android:name="android.speech.RecognitionService"/>
     </intent>
   </queries>

My problem is where and how to add the above code into my cordova project.

I found some suggestions on other site, "write (above) code into cordova config.xml by using edit-config" But I still don't understand how. Could some one give an advice to this very cordova beginner?

CodePudding user response:

I had the same issue, go to config.xml and find:

<config-file target="AndroidManifest.xml" parent="/manifest"> 
<queries>
    <intent>
       <action
              android:name="android.speech.RecognitionService"/>
   </intent>
</queries>
</config-file>

Add the code above and Enjoy!

  • Related