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

Issue with C++ Turbo Module in React Native 0.76.5 (Works in iOS, Not in Android) #48298

Open
cloud2303 opened this issue Dec 17, 2024 · 1 comment
Labels
Needs: Triage 🔍 Platform: Android Android applications. Platform: iOS iOS applications. Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules)

Comments

@cloud2303
Copy link

Description

I am using React Native 0.76.5, and I followed the steps to create a basic C++ Turbo Module demo. However, it does not work on Android, though it works fine on iOS. When I downgrade to React Native 0.76.1, the demo works on both iOS and Android.

Please advise on what might be causing this issue in 0.76.5.
I also came across this pull request, but even after switching to the latest version of OnLoad.cpp, the demo still doesn’t work on 0.76.5. My example repository is using 0.76.1, and I can reproduce the issue by switching to 0.76.5.

Steps to reproduce

  1. npm install

React Native Version

0.76.5

Affected Platforms

Runtime - Android

Areas

TurboModule - The New Native Module System

Output of npx react-native info

System:
  OS: Windows 11 10.0.22631
  CPU: (12) x64 12th Gen Intel(R) Core(TM) i5-12400
  Memory: 558.32 MB / 15.72 GB
Binaries:
  Node:
    version: 20.17.0
    path: C:\Program Files\nodejs\node.EXE
  Yarn: Not Found
  npm:
    version: 10.8.2
    path: C:\Program Files\nodejs\npm.CMD
  Watchman: Not Found
SDKs:
  Android SDK:
    API Levels:
      - "30"
      - "34"
      - "35"
    Build Tools:
      - 30.0.2
      - 34.0.0
      - 35.0.0
    System Images:
      - android-35 | Pre-Release 16 KB Page Size Google Play ARM Intel x86_64
        Atom
    Android NDK: Not Found
  Windows SDK:
    AllowDevelopmentWithoutDevLicense: Enabled
    AllowAllTrustedApps: Enabled
    Versions:
      - 10.0.19041.0
      - 10.0.20348.0
      - 10.0.22621.0
IDEs:
  Android Studio: Not Found
  Visual Studio:
    - 17.9.34701.34 (Visual Studio Professional 2022)
Languages:
  Java:
    version: 17.0.6
    path: /c/Users/fujiahui/.jdks/jbr-17.0.6/bin/javac
  Ruby: Not Found
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.1
    wanted: 0.76.1
  react-native-windows: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

Stacktrace or Logs

dont load the custom cpp module

Reproducer

https://github.com/cloud2303/new-arch-cpp-module-test

Screenshots and Videos

No response

@cloud2303 cloud2303 added Needs: Triage 🔍 Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules) labels Dec 17, 2024
@react-native-bot react-native-bot added Platform: Android Android applications. Platform: iOS iOS applications. labels Dec 17, 2024
@sarthak-d11
Copy link
Contributor

Hey @cloud2303
Would it be possible for you to share a reproducible example using React Native version 0.76.5? As the issue is occurring with this version, and having a sample would be very helpful for further investigation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Triage 🔍 Platform: Android Android applications. Platform: iOS iOS applications. Type: New Architecture Issues and PRs related to new architecture (Fabric/Turbo Modules)
Projects
None yet
Development

No branches or pull requests

3 participants