Open NamHyeongKeol opened 1 week ago
I ran in to this error as well when developing the feature to be able to specify the android service package. The error 14 corresponds to SpeechRecognizer.ERROR_CANNOT_CHECK_SUPPORT
What happens is that I'm calling the SpeechRecognizer.checkRecognitionSupport()
function with the callbacks: onSupportResult()
and onError()
. The issue is that with some of the speech services, both the onError()
and onSupportResult()
fire but I can't actually figure out why that's the case.
So I ended up adding a 50ms timeout on the onError()
invocation which worked okay on my device, but that might just need to be tweaked.
This error occurs quite frequently when using ExpoSpeechRecognitionModule.getSupportedLocales. However, it doesn’t always happen—when running the feature that calls this function multiple times, it works sometimes and fails other times. Usually, the first time the feature is executed after launching the app, the error almost always occurs. After that, it may or may not happen.
Interestingly, after experimenting further, there were cases where the error message ([Error: Failed to retrieve supported locales with error: 14]) didn’t appear at all, and the function simply didn’t run. I am using the fetchSupportedLocalesForAndroid function defined as below, but in this situation, not even a console.log is printed, nor does any error message show up. There was only one instance where this issue occurred, but restarting the phone resolved it.
Is there any way to ensure this function runs reliably?