我在我的cordova(v11)專案中使用cordova-plugin-speechrecognition;它在 android10 或以下設備下運行良好,但不適用于 android11。
當我的應用程式使用語音識別時,android11 設備顯示“系統上沒有語音識別服務”。
我在這個網站上發現了非常相似的問題和答案,它是,
問題:Android 11 Beta系統不提供語音識別服務
答案:在 AndroidManifest.xml 中添加下一個代碼
<queries>
<intent>
<action
android:name="android.speech.RecognitionService"/>
</intent>
</queries>
我的問題是將上述代碼添加到我的cordova專案的位置和方式。
我在其他網站上找到了一些建議,“使用edit-config將(以上)代碼寫入cordova config.xml”但我仍然不明白如何。有人可以給這個非常科爾多瓦初學者的建議嗎?
uj5u.com熱心網友回復:
我有同樣的問題,去 config.xml 并找到:
<config-file target="AndroidManifest.xml" parent="/manifest">
<queries>
<intent>
<action
android:name="android.speech.RecognitionService"/>
</intent>
</queries>
</config-file>
添加上面的代碼并享受!
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/457787.html
