Skip to content

[Android] SpeechRecognizer cannot recognize again after StopRecognitionAsync #26692

In review

Description

@morning4coffe-dev

Current behavior 🐛

On Android, SpeechRecognizer.StopRecognitionAsync() calls Android.Speech.SpeechRecognizer.Destroy() after StopListening(). The native recognizer is released, so any later RecognizeAsync() on the same SpeechRecognizer instance fails. Dispose() does not call Destroy().

Expected behavior 🎯

As on WinUI, StopRecognitionAsync() ends the current recognition session and the same instance can recognize again. The native recognizer is released in Dispose().

How to reproduce it (as minimally and precisely as possible) 🔬

  1. Create a SpeechRecognizer on Android and call CompileConstraintsAsync().
  2. Call RecognizeAsync(), then StopRecognitionAsync().
  3. Call RecognizeAsync() again on the same instance. It fails because the native recognizer was destroyed.

Workaround 🛠️

Create a new SpeechRecognizer after every StopRecognitionAsync().

Affected platforms 📱💻🖥️

Android

Uno.Sdk version (and other relevant versions) 📦

master

IDE version 🧑‍💻

No response

Anything else we need to know? 💬

Source: src/Uno.WinRT/Media/SpeechRecognition/SpeechRecognizer.Android.cs

Activity

  1. added
    kind/bug
    on Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions