Skip to content

🔧 AndroidRuntime: java.lang.IllegalStateException: Tried to access a JS module before the React instance was fully set up. Calls to ReactContext#getJSModule should only happen once initialize() has been called on your native module. #3609

@Amit-Agrawal0177

Description

@Amit-Agrawal0177

How were you trying to build the app?

After using react-native-vision-camera latest ver patch, the project builds successfully, but the app is crashing.

Here’s the logcat output showing the error:

08-22 00:24:18.913 14517 14582 E AndroidRuntime: java.lang.IllegalStateException: Tried to access a JS module before the React instance was fully set up. Calls to ReactContext#getJSModule should only happen once initialize() has been called on your native module.

08-22 00:24:18.913 14517 14582 E AndroidRuntime: at com.facebook.react.bridge.BridgeReactContext.getJSModule(BridgeReactContext.java:111)

08-22 00:24:18.913 14517 14582 E AndroidRuntime: at com.mrousavy.camera.react.CameraDevicesManager.sendAvailableDevicesChangedEvent(CameraDevicesManager.kt:102)

Can anyone please help me figure out what’s going wrong?

Full build logs

08-22 00:24:18.913 14517 14582 E AndroidRuntime: java.lang.IllegalStateException: Tried to access a JS module before the React instance was fully set up. Calls to ReactContext#getJSModule should only happen once initialize() has been called on your native module.
08-22 00:24:18.913 14517 14582 E AndroidRuntime:     at com.facebook.react.bridge.BridgeReactContext.getJSModule(BridgeReactContext.java:111)
08-22 00:24:18.913 14517 14582 E AndroidRuntime:     at com.mrousavy.camera.react.CameraDevicesManager.sendAvailableDevicesChangedEvent(CameraDevicesManager.kt:102)

Project dependencies

"dependencies": {
    "react": "19.1.0",
    "react-native": "^0.81.0",
    "react-native-vision-camera": "^4.7.1",
    "react-native-worklets-core": "^1.6.2"
  }

VisionCamera Version

4.7.1

Target platforms

Android

Operating system

MacOS

Can you build the VisionCamera Example app?

No, I cannot build the Example app either

Additional information

Metadata

Metadata

Assignees

No one assigned

    Labels

    🔧 build errorIssue is related to building VisionCamera in your project

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions