jamsch / expo-speech-recognition

Speech Recognition for React Native Expo projects
MIT License
102 stars 9 forks source link

Expo 51: Cannot read properties of undefined (reading 'speechRecognitionPermission') #30

Closed Andres6936 closed 1 month ago

Andres6936 commented 1 month ago

Hi, to install the library: expo-speech-recognition

And modify the app.json:

{
  "expo": {
    "plugins": [
      "expo-router",
      "expo-font",
      "expo-secure-store",
      "expo-speech-recognition", [
        "expo-speech-recognition", {
          "microphonePermission": "Allow $(PRODUCT_NAME) to use the microphone.",
          "speechRecognitionPermission": "Allow $(PRODUCT_NAME) to use speech recognition.",
          "androidSpeechServicePackages": ["com.google.android.googlequicksearchbox"]
        }
      ]
    ],
  }
}

And get:

TypeError: Cannot read properties of undefined (reading 'speechRecognitionPermission')
TypeError: Cannot read properties of undefined (reading 'speechRecognitionPermission')
    at withExpoSpeechRecognition (C:\Users\Saturno\WebstormProjects\Fedeltamall\fedeltamall\node_modules\expo-speech-recognition\app.plugin.js:76:11)
    at plugin (C:\Users\Saturno\WebstormProjects\Fedeltamall\fedeltamall\node_modules\@expo\config-plugins\build\plugins\withRunOnce.js:49:25)
    at withRunOnce (C:\Users\Saturno\WebstormProjects\Fedeltamall\fedeltamall\node_modules\@expo\config-plugins\build\plugins\withRunOnce.js:37:10)
    at C:\Users\Saturno\WebstormProjects\Fedeltamall\fedeltamall\node_modules\@expo\config-plugins\build\plugins\withRunOnce.js:48:12
    at withStaticPlugin (C:\Users\Saturno\WebstormProjects\Fedeltamall\fedeltamall\node_modules\@expo\config-plugins\build\plugins\withStaticPlugin.js:134:12)
    at C:\Users\Saturno\WebstormProjects\Fedeltamall\fedeltamall\node_modules\@expo\config-plugins\build\plugins\withPlugins.js:30:84
    at Array.reduce (<anonymous>)
    at withPlugins (C:\Users\Saturno\WebstormProjects\Fedeltamall\fedeltamall\node_modules\@expo\config-plugins\build\plugins\withPlugins.js:30:18)
    at withConfigPlugins (C:\Users\Saturno\WebstormProjects\Fedeltamall\fedeltamall\node_modules\@expo\config\build\plugins\withConfigPlugins.js:35:47)
    at fillAndReturnConfig (C:\Users\Saturno\WebstormProjects\Fedeltamall\fedeltamall\node_modules\@expo\config\build\Config.js:229:78)
Andres6936 commented 1 month ago

Resolved, I had repeated the expo-speech-recognition in plugins property