expo-speech-recognition 57.1.0 → 57.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -458,7 +458,11 @@ class ExpoSpeechRecognitionModule : Module() {
458
458
  "installedLocales" to installedLocales,
459
459
  ),
460
460
  )
461
- recognizer.destroy()
461
+ try {
462
+ recognizer.destroy()
463
+ } catch (e: Throwable) {
464
+ // Ignore Android framework bug where unbindService throws IllegalArgumentException
465
+ }
462
466
  }
463
467
 
464
468
  override fun onError(error: Int) {
@@ -477,7 +481,11 @@ class ExpoSpeechRecognitionModule : Module() {
477
481
  )
478
482
  }, 50)
479
483
 
480
- recognizer.destroy()
484
+ try {
485
+ recognizer.destroy()
486
+ } catch (e: Throwable) {
487
+ // Ignore Android framework bug where unbindService throws IllegalArgumentException
488
+ }
481
489
  }
482
490
  },
483
491
  )
@@ -119,7 +119,12 @@ class ExpoSpeechService(
119
119
  log("Start recognition.")
120
120
 
121
121
  // Destroy any previous SpeechRecognizer / audio recorder
122
- speech?.destroy()
122
+ try {
123
+ speech?.destroy()
124
+ } catch (e: Throwable) {
125
+ // Ignore Android framework bug where unbindService throws IllegalArgumentException
126
+ }
127
+ speech = null
123
128
  audioRecorder?.stop()
124
129
  audioRecorder = null
125
130
  delayedFileStreamer?.close()
@@ -241,7 +246,12 @@ class ExpoSpeechService(
241
246
  } catch (e: Exception) {
242
247
  // do nothing
243
248
  }
244
- speech?.destroy()
249
+ try {
250
+ speech?.destroy()
251
+ } catch (e: Throwable) {
252
+ // Ignore Android framework bug where unbindService throws IllegalArgumentException
253
+ }
254
+ speech = null
245
255
  stopRecording()
246
256
  soundState = SoundState.INACTIVE
247
257
  sendEvent("end", null)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-speech-recognition",
3
- "version": "57.1.0",
3
+ "version": "57.1.1",
4
4
  "description": "Speech Recognition for React Native Expo projects",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",