I am trying to use the package speech to text in flutter , I am using a Pixel 6 Pro with android 11, I followed every instruction and set up my build.gradle file the following way :
minSdkVersion 21
targetSdkVersion 33
I also added the following to manifest.xml
<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>
However when im trying to use the functionnality i get this error
E/SpeechToTextPlugin( 7739): Speech recognition not available on this device
E/flutter ( 7739): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(recognizerNotAvailable, Speech recognition not available on this device, , null)
E/flutter ( 7739): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:653:7)
E/flutter ( 7739): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:296:18)
E/flutter ( 7739):
E/flutter ( 7739): #2 MethodChannelSpeechToText.initialize (package:speech_to_text_platform_interface/method_channel_speech_to_text.dart:39:12)
E/flutter ( 7739):
E/flutter ( 7739): #3 SpeechToText.initialize (package:speech_to_text/speech_to_text.dart:288:19)
E/flutter ( 7739):
E/flutter ( 7739): #4 _speech_recoState._listen (package:nut/Pages/speech_reco.dart:105:24)
E/flutter ( 7739):
E/flutter ( 7739):
can someone please help !
I want to convert speech to text
It seems that the error is saying that "Speech recognition is not available on this device". This could be due to several reasons:
The device doesn't have a built-in speech recognition system or doesn't support the speech recognition API you're using.
The required permissions are not granted in your app. Make sure you have added the required permissions in your AndroidManifest.xml file as mentioned in your code snippet.
The speech recognition service you are using is not installed or not configured correctly.
You can try checking if your device has a built-in speech recognition system by searching for the feature in the device settings or by checking the device specifications. If your device doesn't have the feature, you could try using a different speech recognition service or API.
Related
Showing this error when running in esc_pos_bluetooth in flutter i added permission in manifest page but still same error.
> I/flutter (26677): Error starting scan. E/flutter (26677): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] E/flutter (26677): #0 BluetoothManager.scan (package:flutter_bluetooth_basic/src/bluetooth_manager.dart:85:7) E/flutter (26677): <asynchronous suspension>
In android 13 we are facing the below issue we are using this third party camera plugin (https://pub.dev/packages/camera), I would really appreciate the help to solve the issue, Do we need to make some changes in our android version?
E/flutter (14764): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: CameraException(error, Attempt to invoke virtual method 'int android.media.EncoderProfiles$VideoProfile.getWidth()' on a null object reference)
E/flutter (14764): #0 AndroidCamera.createCamera (package:camera_android/src/android_camera.dart:112:7)
E/flutter (14764):
E/flutter (14764): #1 CameraController.initialize (package:camera/src/camera_controller.dart:291:19)
E/flutter (14764):
It's a well known issue that is being tracked here:https://github.com/flutter/flutter/issues/109769
some people came with a solution ( that I haven't tried ) but as of the current state the issue is still not fixed in the latest package version
I had to reinstall Flutter, Android Studio, Sdk, recreate phone emulator, recreate all my Flutter project because time passes and problems and framework bugs pile up. To keep updated all the Flutter environment without problems seems to be impossible. All the things becomes unstable when new and new Flutter and/or Sdk versions come out.
So I reinstalled everything to have a new, perfectly working environment.
Well, now I have a new, never seen, error:
E/flutter ( 3692): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: 'dart:ui/platform_dispatcher.dart': Failed assertion: line 1840 pos 15: '<optimized out>': is not true.
E/flutter ( 3692): #0 _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:51:61)
E/flutter ( 3692): #1 _AssertionError._throwNew (dart:core-patch/errors_patch.dart:40:5)
E/flutter ( 3692): #2 new Locale.fromSubtags (dart:ui/platform_dispatcher.dart:1840:15)
E/flutter ( 3692): #3 PlatformDispatcher._updateLocales (dart:ui/platform_dispatcher.dart:762:29)
E/flutter ( 3692): #4 _updateLocales (dart:ui/hooks.dart:64:31)
E/flutter ( 3692):
My app works, but how can I get rid of that bug?
For the Flutter app I’m working on, the company had a third party develop native Android and iOS code for an alarm to integrate into our app. I ran their sample app that they made and it ran just fine.
I copied the code over to my project and kept getting this error.
E/flutter (17290): [ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: MissingPluginException(No implementation found for method alarmStatus on channel samples.flutter.dev/alarmStatus)
E/flutter (17290): #0 MethodChannel._invokeMethod
E/flutter (17290): #1 _MyHomePageState._getAlarmStatus
E/flutter (17290): <asynchronous suspension>
E/flutter (17290):
E/flutter (17290): [ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: MissingPluginException(No implementation found for method alarmStatus on channel samples.flutter.dev/alarmStatus)
E/flutter (17290): #0 MethodChannel._invokeMethod
E/flutter (17290): <asynchronous suspension>
E/flutter (17290): #1 _MyHomePageState._getAlarmStatus
E/flutter (17290): <asynchronous suspension>
E/flutter (17290):
So, I created a new project and copied the code over and it worked great. While doing some troubleshooting, we found out that this issue sometimes appears with dependencies having issues with each other, so I copied all my dependencies from my app to the new project and got the same error. After commenting out dependencies to find which one may be causing the issue, I landed at the audio_service package. We did some more searching through forums and all, but weren’t able to figure out a solution.
Has anyone run into this issue before and been able to figure out what’s going on? Or have any ideas of what I can try?
I got the recommendation of having the other developers redo the native stuff with a different dependency, but I'm hoping to avoid that if possible.
I use mobile_number plugin, when try to implement example code I have a error:
ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: MissingPluginException(No implementation found for method hasPhonePermission on channel mobile_number)
E/flutter (11696): #0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:157:7)
E/flutter (11696): <asynchronous suspension>
E/flutter (11696): #1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:332:12)
E/flutter (11696): #2 MobileNumber.hasPhonePermission (package:mobile_number/mobile_number.dart:32:24)
The line which generate error is:
if (!await MobileNumber.hasPhonePermission) {
I use Flutter 1.22.6 • channel stable
mobile_number: ^1.0.3
What is the reason and how to avoid such a mistake?
p/s
I installed permissions in Manifest:
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.READ_CALL_LOG"/>
<uses-permission android:name="android.permission.ANSWER_PHONE_CALLS"/>
<uses-permission android:name="android.permission.READ_PHONE_NUMBERS" />
This is most likely due to the fact that you added the plugin and didn't rebuild your app again. Given that you followed the documentation on the pluginpage and added the mainactivity java requirements correct as instructed.
1- Close your emulator\debugging session.
2- Run flutter clean.
3- Give it a new try and it should work, update on the results of these steps please.