Closed answer0732 closed 3 years ago
This is like because that device doesn't have speech recognition installed / enabled. There's information here that should help: https://github.com/csdcorp/speech_to_text/blob/main/speech_to_text/README.md#not-working-on-a-particular-android-device
Hi, thanks for you reply! I found the solution: Modify my targetSdkVersion 30 to 28, and it works!
But I try to keep my file targetSdkVersion 30, and modify the targetSdkVersion of the speech_to_text plugin to 30, it still shows ‘Speech recognition not available on this device’ It only supports 28 ?
Very interesting. I don't know of any changes to 30 that would make it incompatible, but that doesn't mean there aren't any. I'll have to try it on an SDK emulator and see what's up. Thanks for reporting.
I also modified your plugin version to make it consistent with my app, but it also does not work
buildscript {
ext.kotlin_version = '1.4.20' // changed , consistent with my app
....
dependencies {
classpath 'com.android.tools.build:gradle:4.1.1' // changed, consistent with my app
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
android {
compileSdkVersion 30 //changed, consistent with my app
....
}
// gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip // changed, consistent with my app
Seems to only work on 28
Very interesting. I don't know of any changes to 30 that would make it incompatible, but that doesn't mean there aren't any. I'll have to try it on an SDK emulator and see what's up. Thanks for reporting.
ok, thanks !
I've recreated the issue on an Android 30 emulator and resolved it. It seems to be related to a new security requirement on Android 30. Could you try the fix on a real device and let me know if it is working for you? The good news is that it doesn't require any change to the plugin, just to the AndroidManifest.xml
file. I found the solution from this helpful SO post:
https://stackoverflow.com/questions/64319117/speechrecognizer-not-available-when-targeting-android-11 https://developer.android.com/about/versions/11/privacy/package-visibility
Here's the fix:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.csdcorp.speech_to_text_example">
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.INTERNET"/>
<queries>
<intent>
<action android:name="android.speech.RecognitionService" />
</intent>
</queries>
...
The change is the addition of the queries
element.
it works ~ think you!
I've recreated the issue on an Android 30 emulator and resolved it. It seems to be related to a new security requirement on Android 30. Could you try the fix on a real device and let me know if it is working for you? The good news is that it doesn't require any change to the plugin, just to the
AndroidManifest.xml
file. I found the solution from this helpful SO post:https://stackoverflow.com/questions/64319117/speechrecognizer-not-available-when-targeting-android-11 https://developer.android.com/about/versions/11/privacy/package-visibility
Here's the fix:
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.csdcorp.speech_to_text_example"> <uses-permission android:name="android.permission.RECORD_AUDIO"/> <uses-permission android:name="android.permission.INTERNET"/> <queries> <intent> <action android:name="android.speech.RecognitionService" /> </intent> </queries> ...
The change is the addition of the
queries
element.I've recreated the issue on an Android 30 emulator and resolved it. It seems to be related to a new security requirement on Android 30. Could you try the fix on a real device and let me know if it is working for you? The good news is that it doesn't require any change to the plugin, just to the
AndroidManifest.xml
file. I found the solution from this helpful SO post:https://stackoverflow.com/questions/64319117/speechrecognizer-not-available-when-targeting-android-11 https://developer.android.com/about/versions/11/privacy/package-visibility
Here's the fix:
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.csdcorp.speech_to_text_example"> <uses-permission android:name="android.permission.RECORD_AUDIO"/> <uses-permission android:name="android.permission.INTERNET"/> <queries> <intent> <action android:name="android.speech.RecognitionService" /> </intent> </queries> ...
The change is the addition of the
queries
element.
Hello, sir. on HUAWEI P30, this solution does not work
This worked on OnePlus 7T that doesn't even use this library. Thanks!
Uninstall apk from mobile then
Build.gradle
minSdkVersion 21,
targetSdkVersion 30
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.INTERNET"/>
<queries>
<intent>
<action android:name="android.speech.RecognitionService" />
</intent>
</queries>
and run cmd: flutter run
You can open your google search and click on the microphone, then accept the permitions.
I've recreated the issue on an Android 30 emulator and resolved it. It seems to be related to a new security requirement on Android 30. Could you try the fix on a real device and let me know if it is working for you? The good news is that it doesn't require any change to the plugin, just to the
AndroidManifest.xml
file. I found the solution from this helpful SO post:https://stackoverflow.com/questions/64319117/speechrecognizer-not-available-when-targeting-android-11 https://developer.android.com/about/versions/11/privacy/package-visibility
Here's the fix:
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.csdcorp.speech_to_text_example"> <uses-permission android:name="android.permission.RECORD_AUDIO"/> <uses-permission android:name="android.permission.INTERNET"/> <queries> <intent> <action android:name="android.speech.RecognitionService" /> </intent> </queries> ...
The change is the addition of the
queries
element.it works ~ think you!
yeah it work, thanks
I've recreated the issue on an Android 30 emulator and resolved it. It seems to be related to a new security requirement on Android 30. Could you try the fix on a real device and let me know if it is working for you? The good news is that it doesn't require any change to the plugin, just to the
AndroidManifest.xml
file. I found the solution from this helpful SO post:https://stackoverflow.com/questions/64319117/speechrecognizer-not-available-when-targeting-android-11 https://developer.android.com/about/versions/11/privacy/package-visibility
Here's the fix:
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.csdcorp.speech_to_text_example"> <uses-permission android:name="android.permission.RECORD_AUDIO"/> <uses-permission android:name="android.permission.INTERNET"/> <queries> <intent> <action android:name="android.speech.RecognitionService" /> </intent> </queries> ...
The change is the addition of the
queries
element.
I'm having the same issue and this doesn't fix it. Unhandled Exception: PlatformException(recognizerNotAvailable, Speech recognition not available on this device, , null)
I've recreated the issue on an Android 30 emulator and resolved it. It seems to be related to a new security requirement on Android 30. Could you try the fix on a real device and let me know if it is working for you? The good news is that it doesn't require any change to the plugin, just to the
AndroidManifest.xml
file. I found the solution from this helpful SO post: https://stackoverflow.com/questions/64319117/speechrecognizer-not-available-when-targeting-android-11 https://developer.android.com/about/versions/11/privacy/package-visibility Here's the fix:<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.csdcorp.speech_to_text_example"> <uses-permission android:name="android.permission.RECORD_AUDIO"/> <uses-permission android:name="android.permission.INTERNET"/> <queries> <intent> <action android:name="android.speech.RecognitionService" /> </intent> </queries> ...
The change is the addition of the
queries
element.I'm having the same issue and this doesn't fix it. Unhandled Exception: PlatformException(recognizerNotAvailable, Speech recognition not available on this device, , null)
Yeah this solution not working. I tried every way but still im gettinng same error SpeechRec.... not available on this device
ok pour moi
Hello, I'm using pixel2(android 11) to test this plugin, and I have enabled the microphone permission (including flutter app and google), but I got an error, can you tell me the reason, thank you
here is debug info: