-
Notifications
You must be signed in to change notification settings - Fork 22
Description
Description:
Hi there! 👋
I've encountered an issue with AAR packaging when it comes to pure C++ TurboModules, and I'm hoping to get some guidance or see if this is a known limitation.
Environment
- React Native version: 0.76.5
- Platform: Android
- Build type: AAR packaging
Problem Description
The AAR packaging script appears to not support pure C++ TurboModules properly. When I include dependencies like react-native-fs-turbo
, the generated AAR package doesn't contain the native dynamic libraries (.so files) that these modules produce.
Steps to Reproduce
- Add a pure C++ TurboModule dependency (e.g.,
react-native-fs-turbo
) to a React Native project - Build the project into an AAR package using the current packaging script
- Integrate the AAR into an Android app project
- Run the application
Expected Behavior
The AAR should include all necessary native libraries from pure C++ TurboModules, allowing the consuming app to function correctly.
Actual Behavior
The AAR is missing the native dynamic libraries from pure C++ TurboModules. When the consuming app tries to use these modules, it throws:
Exception in native call from JS
com.facebook.react.common.JavascriptException: EarlyJsError: TurboModuleRegistry.getEnforcing(...): 'PlatformConstants' could not be found. Verify that a module by this name is registered in the native binary., stack:
invariant@2126:26
getEnforcing@2818:28
anonymous@2786:68
loadModuleImplementation@267:14
guardedLoadModule@175:38
metroRequire@89:92
anonymous@2764:76
loadModuleImplementation@267:14
guardedLoadModule@175:38
metroRequire@89:92
anonymous@2723:75

Additional Context
I've tested this with multiple pure C++ TurboModules and consistently get the same result. It seems like the packaging process might not be properly detecting or including the native artifacts generated by these modules.
Would it be possible to enhance the AAR packaging to better support pure C++ TurboModules? Or if there's a workaround I should be aware of, I'd greatly appreciate any guidance!
Thanks for your time and for all the great work on this project! 🙏