Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example is not working #16

Open
jorgtz opened this issue Sep 10, 2024 · 9 comments
Open

Example is not working #16

jorgtz opened this issue Sep 10, 2024 · 9 comments

Comments

@jorgtz
Copy link

jorgtz commented Sep 10, 2024

I have cloned this project, then cd into example, then npx expo start and got

expo-speech-recognition/example
Error: Cannot find module 'expo/config-plugins'

How to solve it?
Also what node version is recommended for this project?
Thanks!

@jamsch
Copy link
Owner

jamsch commented Sep 10, 2024

Hi @jorgtz, you'll need to run npm install in the root directory of the project if you haven't already. That should also build the module so that you can use it in the example app.

Also, since this contains a native module that isn't part of the Expo Go app, you'll need to run npm run android or npm run ios once to build and install the app on to your device, before using npm start

sultanmyrza added a commit to sultanmyrza/expo-speech-recognition that referenced this issue Sep 19, 2024
Add notes for Expo beginners

- Include instructions for creating a development build
- Explain how to generate native Android and iOS projects
- Provide best practices for version control
- Add collapsible details section for better readability

I hope this PR prevent these types of issues jamsch#5, jamsch#16 , jamsch#19
jamsch pushed a commit that referenced this issue Sep 19, 2024
Add notes for Expo beginners

- Include instructions for creating a development build
- Explain how to generate native Android and iOS projects
- Provide best practices for version control
- Add collapsible details section for better readability

I hope this PR prevent these types of issues #5, #16 , #19
@danny188
Copy link

I encountered the same error. The error is still there after I ran npm install

image

@jamsch
Copy link
Owner

jamsch commented Oct 1, 2024

Hey @danny188 Just to confirm: have you ran npm install inside both expo-speech-recognition-main\ and expo-speech-recognition-main\example\? I'll get a Windows machine to test it out soon.

@danny188
Copy link

danny188 commented Oct 1, 2024

Hi @jamsch , I was able to build after running npm install inside expo-speech-recognition-main\ (previously only ran inside expo-speech-recognition-main\example\). I've now ran into some new errors when trying to test it on Android 9.

image

MINGW64 /c/local_documents/programming/expo/expo-speech-recognition-main/example
$ npx expo run:android
› Building app...
Starting a Gradle Daemon, 2 stopped Daemons could not be reused, use --status for details
Configuration on demand is an incubating feature.
Warning: SDK processing. This version only understands SDK XML versions up to 3 but an SDK XML file of version 4 was encountered. This can happen if you use 
versions of Android Studio and the command-line tools that were released at different times.

> Configure project :expo

Using expo modules
  - expo-asset (10.0.10)
  - expo-av (14.0.7)
  - expo-constants (16.0.2)
  - expo-file-system (17.0.1)
  - expo-font (12.0.10)
  - expo-keep-awake (13.0.2)
  - expo-modules-core (1.12.24)
  - expo-speech-recognition (0.2.21)
  - expo-splash-screen (0.27.5)


> Task :expo-file-system:processDebugManifest
C:\local_documents\programming\expo\expo-speech-recognition-main\example\node_modules\expo-file-system\android\src\main\AndroidManifest.xml:6:9-8:20 Warning 
        provider#expo.modules.filesystem.FileSystemFileProvider@android:authorities was tagged at AndroidManifest.xml:6 to replace other declarations but no 
other declaration present

> Task :expo-modules-core:processDebugManifest
C:\local_documents\programming\expo\expo-speech-recognition-main\example\node_modules\expo-modules-core\android\src\main\AndroidManifest.xml:8:9-11:45 Warning:
        meta-data#com.facebook.soloader.enabled@android:value was tagged at AndroidManifest.xml:8 to replace other declarations but no other declaration present

> Task :app:processDebugMainManifest
C:\local_documents\programming\expo\expo-speech-recognition-main\example\android\app\src\debug\AndroidManifest.xml:6:5-162 Warning:
        application@android:usesCleartextTraffic was tagged at AndroidManifest.xml:6 to replace other declarations but no other declaration present
C:\local_documents\programming\expo\expo-speech-recognition-main\example\android\app\src\debug\AndroidManifest.xml Warning:
        provider#expo.modules.filesystem.FileSystemFileProvider@android:authorities was tagged at AndroidManifest.xml:0 to replace other declarations but no 
other declaration present

> Task :expo-modules-core:compileDebugKotlin
w: file:///C:/local_documents/programming/expo/expo-speech-recognition-main/example/node_modules/expo-modules-core/android/src/main/java/expo/modules/adapters/react/permissions/PermissionsService.kt:20:26 'Promise' is deprecated. AsyncFunction will crash when called. Use expo.modules.kotlin.Promise instead       
w: file:///C:/local_documents/programming/expo/expo-speech-recognition-main/example/node_modules/expo-modules-core/android/src/main/java/expo/modules/adapters/react/permissions/PermissionsService.kt:63:51 'Promise' is deprecated. AsyncFunction will crash when called. Use expo.modules.kotlin.Promise instead       
w: file:///C:/local_documents/programming/expo/expo-speech-recognition-main/example/node_modules/expo-modules-core/android/src/main/java/expo/modules/adapters/react/permissions/PermissionsService.kt:90:54 'Promise' is deprecated. AsyncFunction will crash when called. Use expo.modules.kotlin.Promise instead       
w: file:///C:/local_documents/programming/expo/expo-speech-recognition-main/example/node_modules/expo-modules-core/android/src/main/java/expo/modules/kotlin/defaultmodules/CoreModule.kt:6:34 'ReactFeatureFlags' is deprecated. Deprecated in Java
w: file:///C:/local_documents/programming/expo/expo-speech-recognition-main/example/node_modules/expo-modules-core/android/src/main/java/expo/modules/kotlin/defaultmodules/CoreModule.kt:70:12 'ReactFeatureFlags' is deprecated. Deprecated in Java
w: file:///C:/local_documents/programming/expo/expo-speech-recognition-main/example/node_modules/expo-modules-core/android/src/main/java/expo/modules/kotlin/events/KModuleEventEmitterWrapper.kt:97:7 'constructor Event<T : Event<(raw) Event<*>>!>(Int)' is deprecated. Deprecated in Java
w: file:///C:/local_documents/programming/expo/expo-speech-recognition-main/example/node_modules/expo-modules-core/android/src/main/java/expo/modules/kotlin/types/JSTypeConverterHelper.kt:44:17 'get(String!): Any?' is deprecated. Deprecated in Java

> Task :expo-modules-core:compileDebugJavaWithJavac
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

> Task :expo-splash-screen:compileDebugKotlin
w: file:///C:/local_documents/programming/expo/expo-speech-recognition-main/example/node_modules/expo-splash-screen/android/src/main/java/expo/modules/splashscreen/SplashScreenViewController.kt:42:5 Parameter 'failureCallback' is never used
w: file:///C:/local_documents/programming/expo/expo-speech-recognition-main/example/node_modules/expo-splash-screen/android/src/main/java/expo/modules/splashscreen/singletons/SplashScreenStatusBar.kt:16:27 'replaceSystemWindowInsets(Int, Int, Int, Int): WindowInsets' is deprecated. Deprecated in Java
w: file:///C:/local_documents/programming/expo/expo-speech-recognition-main/example/node_modules/expo-splash-screen/android/src/main/java/expo/modules/splashscreen/singletons/SplashScreenStatusBar.kt:17:29 'getter for systemWindowInsetLeft: Int' is deprecated. Deprecated in Java
w: file:///C:/local_documents/programming/expo/expo-speech-recognition-main/example/node_modules/expo-splash-screen/android/src/main/java/expo/modules/splashscreen/singletons/SplashScreenStatusBar.kt:19:29 'getter for systemWindowInsetRight: Int' is deprecated. Deprecated in Java
w: file:///C:/local_documents/programming/expo/expo-speech-recognition-main/example/node_modules/expo-splash-screen/android/src/main/java/expo/modules/splashscreen/singletons/SplashScreenStatusBar.kt:20:29 'getter for systemWindowInsetBottom: Int' is deprecated. Deprecated in Java

> Task :expo-av:compileDebugKotlin
w: file:///C:/local_documents/programming/expo/expo-speech-recognition-main/example/node_modules/expo-av/android/src/main/java/expo/modules/av/ViewUtils.kt:10:26 'Promise' is deprecated. AsyncFunction will crash when called. Use expo.modules.kotlin.Promise instead
w: file:///C:/local_documents/programming/expo/expo-speech-recognition-main/example/node_modules/expo-av/android/src/main/java/expo/modules/av/ViewUtils.kt:19:129 'Promise' is deprecated. AsyncFunction will crash when called. Use expo.modules.kotlin.Promise instead
w: file:///C:/local_documents/programming/expo/expo-speech-recognition-main/example/node_modules/expo-av/android/src/main/java/expo/modules/av/ViewUtils.kt:21:78 'resolveView(Int): View?' is deprecated. Deprecated in Java
w: file:///C:/local_documents/programming/expo/expo-speech-recognition-main/example/node_modules/expo-av/android/src/main/java/expo/modules/av/ViewUtils.kt:39:111 'Promise' is deprecated. AsyncFunction will crash when called. Use expo.modules.kotlin.Promise instead
w: file:///C:/local_documents/programming/expo/expo-speech-recognition-main/example/node_modules/expo-av/android/src/main/java/expo/modules/av/ViewUtils.kt:52:78 'resolveView(Int): View?' is deprecated. Deprecated in Java
w: file:///C:/local_documents/programming/expo/expo-speech-recognition-main/example/node_modules/expo-av/android/src/main/java/expo/modules/av/player/datasource/CustomHeadersOkHttpDataSourceFactory.kt:32:12 'constructor OkHttpDataSource(Call.Factory, String?, CacheControl?, HttpDataSource.RequestProperties?)' is 
deprecated. Deprecated in Java
w: file:///C:/local_documents/programming/expo/expo-speech-recognition-main/example/node_modules/expo-av/android/src/main/java/expo/modules/av/progress/AndroidLooperTimeMachine.kt:8:5 'constructor Handler()' is deprecated. Deprecated in Java
w: file:///C:/local_documents/programming/expo/expo-speech-recognition-main/example/node_modules/expo-av/android/src/main/java/expo/modules/av/video/VideoViewModule.kt:64:17 'tryRunWithVideoView(ModuleRegistry, Int, ViewUtils.VideoViewCallback, Promise): Unit' is deprecated. Use `dispatchCommands` in favor of finding view with imperative calls

> Task :expo-av:compileDebugJavaWithJavac
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

> Task :expo:compileDebugKotlin
w: file:///C:/local_documents/programming/expo/expo-speech-recognition-main/example/node_modules/expo/android/src/main/java/expo/modules/ReactActivityDelegateWrapper.kt:20:34 'ReactFeatureFlags' is deprecated. Deprecated in Java
w: file:///C:/local_documents/programming/expo/expo-speech-recognition-main/example/node_modules/expo/android/src/main/java/expo/modules/ReactActivityDelegateWrapper.kt:153:11 'ReactFeatureFlags' is deprecated. Deprecated in Java
w: file:///C:/local_documents/programming/expo/expo-speech-recognition-main/example/node_modules/expo/android/src/main/java/expo/modules/ReactActivityDelegateWrapper.kt:161:34 'constructor ReactDelegate(Activity!, ReactNativeHost!, String?, Bundle?)' is deprecated. Deprecated in Java
w: file:///C:/local_documents/programming/expo/expo-speech-recognition-main/example/node_modules/expo/android/src/main/java/expo/modules/ReactActivityDelegateWrapper.kt:231:10 'ReactFeatureFlags' is deprecated. Deprecated in Java

BUILD SUCCESSFUL in 3m 33s
260 actionable tasks: 182 executed, 69 from cache, 9 up-to-date
Starting Metro Bundler
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
█ ▄▄▄▄▄ █▄▀▀▄▄█▄█▄█▄▀▀█ ██▀▀█▀█ ▄▄▄▄▄ █
█ █   █ ███▄█  ▀█▄▀ ██ ▄█▀ █▄▀█ █   █ █
█ █▄▄▄█ ██▄▀▄▀████▀█▄▀▀█▀▀█▄█ █ █▄▄▄█ █
█▄▄▄▄▄▄▄█ █ ▀▄▀▄█▄█▄▀▄█ ▀▄▀▄▀ █▄▄▄▄▄▄▄█
█▄▄█▄▄▀▄▀█▄▄▄ ██▀▀ ▀ ▄██▀█▀ ▀ █▄▀▀▀██▄█
█▀████▀▄▄▀▄  ▀▄█▄   ▀▀▄▀ ██▀ █ ▀▄█▀▀▀▄█
█▄▀ ▄▀█▄▄█▄▀ ▀█▄ ████▀▀█ ▄▀█▀ ▀▄▄▀ ▀███
█▀█▄   ▄▀█ ▀█ ▄▀ ▄█▀ ▄▄██▄▄▀ ██▄▀▀▀▀▀▄█
█ █ ▀█ ▄▀▄ ██▀ ▄▄█▀█ ▄█ ▄▄ █▀█▀▄▀█  ▀██
█ ▄▀█▄▄▄█▄  ▄ ▀▀ ▄▄▀ ▄▄▀▄█ ▀▄█▀ █  ▄█ █
█   ▀▄ ▄▀▀▀ ▀▀██ ▀▄█ ▄▀▀  █ ▀▄▄▄  ▀▀▀▄█
██▀█ ▄▄▄ ██▄  ▄▄▄▄  ▀ █ ▄██▀▄█▄▄█▄▀▀▀ █
█ █▄▀  ▄ ▄▄▄▀▀▀▄ ▄█ █▄█▀▀▄█▄ ▀█▄█▀ ▀ ██
█ ▄▀▀█▀▄█ █ █▀▄▀ ▄██▄▄▄▀█ █▀▄▀ ██     █
█▄███▄▄▄▄    ▄ ▄▄█▀▄▀ ▀▀▄█ ▄█ ▄▄▄   ▀▄█
█ ▄▄▄▄▄ ██▀█ ▀▀▀ ▄█▄ ▀▄▀▄ ▀█▀ █▄█ ▀▄█▄█
█ █   █ █ █▄▀▀██ ▀█▀▀██▀ █▀▀▄▄   ▄█▀▄▄█
█ █▄▄▄█ █▀▄  ██▀▄▄ ▄█ ██ █▄▀█▄▄▀▄ █ ▀ █
█▄▄▄▄▄▄▄█▄▄▄▄▄█▄▄▄█▄█▄██▄▄███▄████▄██▄█

› Metro waiting on expo.modules.speechrecognition.example://expo-development-client/?url=http%3A%2F%2F192.168.20.5%3A8081
› Scan the QR code above to open the project in a development build. Learn more: https://expo.fyi/start

› Web is waiting on http://localhost:8081

› Using development build
› Press s │ switch to Expo Go

› Press a │ open Android
› Press w │ open web

› Press j │ open debugger
› Press r │ reload app
› Press m │ toggle menu
› Press o │ open project code in your editor

› Press ? │ show all commands

› Opening on Android...
CommandError: No development build (expo.modules.speechrecognition.example) for this project is installed. Please make and install a development build on the device first.
Learn more: https://docs.expo.dev/development/build/
› Opening expo.modules.speechrecognition.example://expo-development-client/?url=http%3A%2F%2F192.168.20.5%3A8081 on SM_G9550

› Logs for your project will appear below. Press Ctrl+C to exit.
Android Bundled 5908ms C:\local_documents\programming\expo\expo-speech-recognition-main\example\node_modules\expo\AppEntry.js (1259 modules)
 (NOBRIDGE) LOG  Bridgeless mode is enabled
 (NOBRIDGE) ERROR  Warning: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.
    at App (http://localhost:8081/node_modules/expo/AppEntry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=expo.modules.speechrecognition.example&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:129634:41)
    at withDevTools(App) (http://localhost:8081/node_modules/expo/AppEntry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=expo.modules.speechrecognition.example&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:129415:27)
    at RCTView
    at View (http://localhost:8081/node_modules/expo/AppEntry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=expo.modules.speechrecognition.example&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:68456:43)
    at RCTView
    at View (http://localhost:8081/node_modules/expo/AppEntry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=expo.modules.speechrecognition.example&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:68456:43)
    at AppContainer (http://localhost:8081/node_modules/expo/AppEntry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=expo.modules.speechrecognition.example&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:68299:25)
    at main(RootComponent) (http://localhost:8081/node_modules/expo/AppEntry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=expo.modules.speechrecognition.example&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:116635:28)
 (NOBRIDGE) ERROR  Warning: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.
    at App (http://localhost:8081/node_modules/expo/AppEntry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=expo.modules.speechrecognition.example&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:129634:41)
    at withDevTools(App) (http://localhost:8081/node_modules/expo/AppEntry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=expo.modules.speechrecognition.example&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:129415:27)
    at RCTView
    at View (http://localhost:8081/node_modules/expo/AppEntry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=expo.modules.speechrecognition.example&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:68456:43)
    at RCTView
    at View (http://localhost:8081/node_modules/expo/AppEntry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=expo.modules.speechrecognition.example&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:68456:43)
    at AppContainer (http://localhost:8081/node_modules/expo/AppEntry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=expo.modules.speechrecognition.example&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:68299:25)
    at main(RootComponent) (http://localhost:8081/node_modules/expo/AppEntry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=expo.modules.speechrecognition.example&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:116635:28)
 (NOBRIDGE) ERROR  Warning: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.
    at App (http://localhost:8081/node_modules/expo/AppEntry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=expo.modules.speechrecognition.example&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:129634:41)
    at withDevTools(App) (http://localhost:8081/node_modules/expo/AppEntry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=expo.modules.speechrecognition.example&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:129415:27)
    at RCTView
    at View (http://localhost:8081/node_modules/expo/AppEntry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=expo.modules.speechrecognition.example&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:68456:43)
    at RCTView
    at View (http://localhost:8081/node_modules/expo/AppEntry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=expo.modules.speechrecognition.example&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:68456:43)
    at AppContainer (http://localhost:8081/node_modules/expo/AppEntry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=expo.modules.speechrecognition.example&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:68299:25)
    at main(RootComponent) (http://localhost:8081/node_modules/expo/AppEntry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=expo.modules.speechrecognition.example&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:116635:28)
 (NOBRIDGE) ERROR  Warning: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.
    at App (http://localhost:8081/node_modules/expo/AppEntry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=expo.modules.speechrecognition.example&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:129634:41)
    at withDevTools(App) (http://localhost:8081/node_modules/expo/AppEntry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=expo.modules.speechrecognition.example&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:129415:27)
    at RCTView
    at View (http://localhost:8081/node_modules/expo/AppEntry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=expo.modules.speechrecognition.example&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:68456:43)
    at RCTView
    at View (http://localhost:8081/node_modules/expo/AppEntry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=expo.modules.speechrecognition.example&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:68456:43)
    at AppContainer (http://localhost:8081/node_modules/expo/AppEntry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=expo.modules.speechrecognition.example&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:68299:25)
    at main(RootComponent) (http://localhost:8081/node_modules/expo/AppEntry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=expo.modules.speechrecognition.example&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:116635:28)
 (NOBRIDGE) ERROR  TypeError: Cannot read property 'useRef' of null

This error is located at:
    in App (created by withDevTools(App))
    in withDevTools(App)
    in RCTView (created by View)
    in View (created by AppContainer)
    in RCTView (created by View)
    in View (created by AppContainer)
    in AppContainer
    in main(RootComponent)
 (NOBRIDGE) ERROR  TypeError: Cannot read property 'useRef' of null

This error is located at:
    in App (created by withDevTools(App))
    in withDevTools(App)
    in RCTView (created by View)
    in View (created by AppContainer)
    in RCTView (created by View)
    in View (created by AppContainer)
    in AppContainer
    in main(RootComponent)

@jamsch
Copy link
Owner

jamsch commented Oct 1, 2024

@danny188 The Cannot read property 'useRef' of null error usually has something to do with how the npm packages were installed. What npm/node versions are you running, and are you running npm install?

@danny188
Copy link

danny188 commented Oct 1, 2024

Hi @jamsch , npm version 10.7.0
I have run npm install inside both expo-speech-recognition-main and expo-speech-recognition-main\example.

There was a npm error when I ran npm install inside expo-speech-recognition-main:

image

@jamsch
Copy link
Owner

jamsch commented Oct 1, 2024

@danny188 Unfortunately it seems like expo-module-scripts doesn't support Windows so I'm not sure what can be done there. I think the best luck you'll have running the example app is to do the following:

  • Remove example/metro.config.js
  • Remove the following from example/tsconfig.json:
 "paths": {
      "expo-speech-recognition": ["../src/index"],
      "expo-speech-recognition/*": ["../src/*"]
    },
  • Remove the "plugins" section from example/babel.config.js:
plugins: [
      [
        "module-resolver",
        {
          extensions: [".tsx", ".ts", ".js", ".json"],
          alias: {
            // For development, we want to alias the library to the source
            "expo-speech-recognition": path.join(
              __dirname,
              "..",
              "src",
              "index.ts",
            ),
          },
        },
      ],
    ],
  • Add "expo-speech-recognition": "0.2.21", under the "dependencies" section in example/package.json
  • Run npm install and then npm run android

@jamsch
Copy link
Owner

jamsch commented Oct 1, 2024

@danny188 Also, I've just tested the permissions on an Android 9 emulator and it seems okay. I did have a slight bug on the example app where the state wasn't reset if the user denied permissions but I've pushed a small fix for that right now.

Screenshot 2024-10-01 at 4 48 58 PM

@danny188
Copy link

danny188 commented Oct 1, 2024

@danny188 Unfortunately it seems like expo-module-scripts doesn't support Windows so I'm not sure what can be done there. I think the best luck you'll have running the example app is to do the following:

  • Remove example/metro.config.js
  • Remove the following from example/tsconfig.json:
 "paths": {
      "expo-speech-recognition": ["../src/index"],
      "expo-speech-recognition/*": ["../src/*"]
    },
  • Remove the "plugins" section from example/babel.config.js:
plugins: [
      [
        "module-resolver",
        {
          extensions: [".tsx", ".ts", ".js", ".json"],
          alias: {
            // For development, we want to alias the library to the source
            "expo-speech-recognition": path.join(
              __dirname,
              "..",
              "src",
              "index.ts",
            ),
          },
        },
      ],
    ],
  • Add "expo-speech-recognition": "0.2.21", under the "dependencies" section in example/package.json
  • Run npm install and then npm run android

@jamsch I was able to run the example app after your suggested changes :D Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants