Skip to content

Android Old Arch Native Event Emitter - RN no longer receiving events while not current activity #51109

Open

Description

@henrygrant

Description

My application is a brownfield app that React Native was added to a couple of years ago. We have a couple of screens we have not rewritten yet. For example, our "change address" screen is still native, but many React Native based screens switch to the "change address" activity to enable our users to take that action.

Since we started our RN integration, we have emitted an event from the native screen that RN would "catch" and key off of as an indicator that we need to reload the customer data. When we updated to RN77, the RN instance stopped receiving events. In my project's code, I nullcheck reactContext and check the context's hasActiveReactInstance() (which replaced hasActiveCatalystInstance()). If any of those are false, I add the events to a queue that will be processed when the ReactInstance comes back. This doesn't function however, because hasActiveReactInstance() comes back as true even when I'm on a native activity.

This only occurs when a native activity is sending the event. If I fire an event from calling a bridge function, RN will receive the event. This isn't so useful though, as we rely on firing events from native screens that aren't aware of RN and pick them up on the RN side.

I haven't been able to find anything in the 77 changelog that changed this, but anecdotally it seems like the app no longer is executing javascript while a native activity is running. This wouldn't be a problem if I had something I could go off of to know when or when not to queue events, but it doesn't seem like hasActiveReactInstance() is my answer.

I'll also mention that I saw this issue on New Architecture, but switched back to Old Architecture expecting that to resolve the issue.

Steps to reproduce

npm i
npm run android
npm start, open debugger

In the reproduction in the description, you will land on a RN-based screen that has a button to go to a native activity. Tapping that will land you on a native screen with a button that will emit an event to RN. RN will never catch this event, as when you get back to the RN screen there is no evidence the event was ever fired. This was not the case in 76 (or 68-77), that event was processed even though a ReactActivity wasn't the current activity.

React Native Version

0.77.1

Affected Platforms

Runtime - Android

Output of npx @react-native-community/cli info

System:
  OS: macOS 15.4.1
  CPU: (8) arm64 Apple M1
  Memory: 102.36 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.18.1
    path: ~/.nvm/versions/node/v20.18.1/bin/node
  Yarn:
    version: 1.22.19
    path: /opt/homebrew/bin/yarn
  npm:
    version: 10.8.2
    path: ~/.nvm/versions/node/v20.18.1/bin/npm
  Watchman:
    version: 2025.03.10.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.16.2
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.4
      - iOS 18.4
      - macOS 15.4
      - tvOS 18.4
      - visionOS 2.4
      - watchOS 11.4
  Android SDK: Not Found
IDEs:
  Android Studio: 2024.3 AI-243.24978.46.2431.13208083
  Xcode:
    version: 16.3/16E140
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.15
    path: /usr/bin/javac
  Ruby:
    version: 3.4.2
    path: /opt/homebrew/opt/ruby/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.77.1
    wanted: 0.77.1
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: Not found
  newArchEnabled: false

Stacktrace or Logs

no stacktrace

MANDATORY Reproducer

https://github.com/henrygrant/reproducer-react-native-event-debug/tree/77-events

Screenshots and Videos

Image Image Image

Activity

  1. react-native-bot commented on May 5, 2025

    @react-native-bot
    Collaborator

    Tip

    Newer version available: You are on a supported minor version, but it looks like there's a newer patch available - 0.77.2. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.

  2. react-native-bot commented on May 5, 2025

    @react-native-bot
    Collaborator

    Tip

    Newer version available: You are on a supported minor version, but it looks like there's a newer patch available - undefined. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.

  3. cipolleschi commented on May 6, 2025

    @cipolleschi
    Contributor

    This looks very similar to #50327.
    @cortinico is investigating the issue already.

  4. henrygrant commented on May 6, 2025

    @henrygrant
    Author

    I'll highlight that, at least in this case, this seems to be an issue with RN0.77.x coming from 76, as opposed to new arch/old arch

  5. cortinico commented on May 7, 2025

    @cortinico
    Contributor

    I'll also mention that I saw this issue on New Architecture, but switched back to Old Architecture expecting that to resolve the issue.

    Q: Did old arch solve this issue or not? This is not clear from your issue

  6. henrygrant commented on May 7, 2025

    @henrygrant
    Author

    No, switching to old arch did not solve this problem.

    The issue was reported to my team on a new arch testing branch, but after I disabled new arch I continued seeing issues. All of my findings provided in the original issue were found using old arch, and the reproducer is using old arch.

  7. react-native-bot commented on Nov 4, 2025

    @react-native-bot
    Collaborator

    This issue is stale because it has been open for 180 days with no activity. It will be closed in 7 days unless you comment on it or remove the "Stale" label.

  8. added
    StaleThere has been a lack of activity on this issue and it may be closed soon.
    and removed
    StaleThere has been a lack of activity on this issue and it may be closed soon.
    on Nov 4, 2025
  9. react-native-bot commented on May 3, 2026

    @react-native-bot
    Collaborator

    This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

  10. added
    StaleThere has been a lack of activity on this issue and it may be closed soon.
    and removed
    StaleThere has been a lack of activity on this issue and it may be closed soon.
    on May 3, 2026
  11. Gowshik-MSG commented on May 5, 2026

    @Gowshik-MSG

    Any update on this

  12. react-native-bot commented on Nov 2, 2026

    @react-native-bot
    Collaborator

    This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

  13. added
    StaleThere has been a lack of activity on this issue and it may be closed soon.
    and removed
    StaleThere has been a lack of activity on this issue and it may be closed soon.
    on Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions