facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
119.29k stars 24.35k forks source link

Unable to get reactContext in MainActivity.kt #47647

Open saikrishnanamburi opened 3 hours ago

saikrishnanamburi commented 3 hours ago

Description

val reactContext: ReactContext? = this.reactNativeHost.reactInstanceManager.currentReactContext ReactContext: null

Steps to reproduce

npm start

React Native Version

0.76.2

Affected Platforms

Runtime - Android

Output of npx react-native info

System:
  OS: macOS 15.0.1
  CPU: (8) arm64 Apple M3
  Memory: 91.66 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.0.0
    path: ~/.nvm/versions/node/v20.0.0/bin/node
  Yarn:
    version: 1.22.22
    path: /opt/homebrew/bin/yarn
  npm:
    version: 9.6.4
    path: ~/.nvm/versions/node/v20.0.0/bin/npm
  Watchman:
    version: 2024.10.21.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.0
      - iOS 18.0
      - macOS 15.0
      - tvOS 18.0
      - visionOS 2.0
      - watchOS 11.0
  Android SDK:
    API Levels:
      - "28"
      - "29"
      - "30"
      - "31"
      - "33"
      - "34"
      - "34"
      - "34"
      - "34"
      - "34"
      - "35"
    Build Tools:
      - 28.0.3
      - 30.0.3
      - 31.0.0
      - 33.0.0
      - 33.0.1
      - 33.0.2
      - 34.0.0
      - 35.0.0
    System Images:
      - android-30 | Intel x86 Atom_64
      - android-31 | Intel x86 Atom_64
      - android-33 | Google APIs ARM 64 v8a
    Android NDK: Not Found
IDEs:
  Android Studio: 2024.2 AI-242.23339.11.2421.12483815
  Xcode:
    version: 16.0/16A242d
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.13
    path: /opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk/Contents/Home/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 15.0.1
    wanted: 15.0.1
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.76.2
    wanted: 0.76.2
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true

Stacktrace or Logs

.

Reproducer

.

Screenshots and Videos

No response

react-native-bot commented 3 hours ago

[!WARNING] Missing reproducer: We could not detect a reproducible example in your issue report. Please provide either: