Open FaFre opened 2 weeks ago
Is this on a real device or a simulator? If real which device?
I'm definitely not happy with that method of getting the locales. Sure wish Android with fix the default previously working method or implement their suggested new method consistently. However, I've never seen it just hang. That's very surprising. Can you do a run with debugLogging: true
in the initialize
call and post the log output?
This is on a real device Xiaomi Poco F3 (M2012K11AG). I use LineageOS 20 (Android 13) with all available Android patches until 05.04.2024, so the System is very up-to date.
This is the output:
D/SpeechToTextPlugin(11005): Start initialize
D/SpeechToTextPlugin(11005): Checked permission
D/SpeechToTextPlugin(11005): has permission, completing
D/SpeechToTextPlugin(11005): completeInitialize
D/SpeechToTextPlugin(11005): Testing recognition availability
D/BluetoothHeadset(11005): Binding service...
D/SpeechToTextPlugin(11005): sending result
D/SpeechToTextPlugin(11005): leaving complete
D/SpeechToTextPlugin(11005): leaving initializeIfPermitted
D/BluetoothHeadset(11005): Proxy object connected
D/SpeechToTextPlugin(11005): Found a headset: android.bluetooth.BluetoothHeadset@1be0189
I/Gralloc4(11005): Adding additional valid usage bits: 0x546c08202000
I should have everything set up:
So on newer Android builds locales are retrieved using on device speech recognition if it is available. From what I've seen in the past some devices, possibly including Xiaomi do not fully implement all parts of Android. I think there is/was some disagreement with Google that blocked it. I wonder if the on device speech recognition is not working. I'll have a look at the way it looks up the on device and see if maybe it's failing to catch an exception or something there.
I'm using LineageOS which should be almost vanilla Android.
@sowens-csd when you can give me a bit of guidance on how to debug it, I will happily do it. I'm just not really familiar with native android to build up a small test application with ease.
Thanks for the offer. I’d love to work with you on it. Unfortunately it will be a few weeks. I’ll post again when I can work on it. Sorry for the delay.
I tried to run the example but the call
SpeechToTextPlatform.instance.locales()
is never returning on my device. I tried several rebuilds and reinstalls, but it wouldn't work. I have two languages offline installed. I tried to fish with logcat, but there is nothing. Flutter is not throwing anything as well.Edit: Tag v6.2.0 is working (but only showing one of my two available languages), all version above are not working. I'm on Flutter 3.21.0-1.0.pre.2
Edit: After setting up a new example I can identify that the following version breaks the locales platform call on my device (Android 13):