-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
[0.76] Project with custom C++ code - Crashes with EarlyJsError: TurboModuleRegistry.getEnforcing(...): 'PlatformConstants' could not be found. Verify that a module by this name is registered in the native binary
#47352
Comments
|
|
We're getting this too since upgrading to 0.76 in production on specific phones, mostly Android 14. Haven't been able to reproduce in development:
New architecture is disabled for us. |
EarlyJsError: TurboModuleRegistry.getEnforcing(...): 'PlatformConstants' could not be found. Verify that a module by this name is registered in the native binary
Sort of a duplicate of: #38467 However for your specific scenario we would need a fix inside core: Moreover you will have to update your cmake_minimum_required(VERSION 3.22.1)
project(appmodules)
# This file includes all the necessary to let you build your application with the New Architecture.
include(${REACT_ANDROID_DIR}/cmake-utils/ReactNative-application.cmake)
add_library(secrets STATIC src/main/cpp/secrets.cpp)
target_link_libraries(secrets android log)
target_link_libraries(${CMAKE_PROJECT_NAME}
secrets) That's because you're providing your own CMake file and not the app default. react-native/packages/react-native/ReactAndroid/cmake-utils/default-app-setup/CMakeLists.txt Lines 6 to 23 in dc9db01
|
It might be the case for auliakbarh, but the weird this is we're not using any custom C++ or CMakeLists.txt in our project. I did a search through our project, and the only time I can see PlatformConstants attempting to be accessed is in react-native-gesture-handler. Perhaps that package needs to implement this fix? |
Please don't hijack this issue. Open another issue and provide a separate reproducer as otherwise is extremely complicated for us to help everyone. |
I tried to update my |
Correct |
Summary: Fixes #47352 This fixes a bug when the user is providing its own CMakeLists.txt file say because they want to compile more C++ code than we actually provide. Previously the `*.cpp` will evalute file in the current directory, meaning that the app's default `OnLoad.cpp` file would be ignored. ## Changelog: [ANDROID] [FIXED] - Use absolute path when compiling appmodules.so sources Pull Request resolved: #47379 Test Plan: Tested against the reproducer provided in: - Use absolute path when compiling appmodules.so sources Reviewed By: cipolleschi Differential Revision: D65428676 Pulled By: cortinico fbshipit-source-id: 7f3e4d470da0fffc5191c1a2c7e8fec517fee496
Created an Android
The notification works fine in the background and foreground state. |
is the absolute path fixing the problem for you? |
No, it's not fixing. The error occurs when a Firebase notification is triggered to the release variant apk in its killed state. It can be viewed in the Android logcat. |
same problem here..i managed to reproduce it. |
The error generated in this case is as follows.
|
Same. jerinjohnk Have you found a workaround or fix? |
No @RohovDmytro, for the time being, I just downgraded the RN version to "0.75.4". And changed the line Rest all gradle upgrade and other changes didn't downgrade them. |
Description
I'm using "react-native": "0.76.0", and I tried to implement ndk but I got an error:
I need to secure my env since in react-native-config mentioned
Keep in mind this module doesn't obfuscate or encrypt secrets for packaging, so do not store sensitive keys in .env
in
android/app/build.gradle
:That lines causing the error, but when I remove those lines I can't use the secrets.
can anyone help me?
Steps to reproduce
Try to implement these:
React Native Version
0.76.0
Affected Platforms
Runtime - Android
Areas
TurboModule - The New Native Module System
Output of
npx react-native info
Stacktrace or Logs
Reproducer
https://github.com/auliakbarh/reproduce-error-turbomodule-rn-using-cmake
Screenshots and Videos
The text was updated successfully, but these errors were encountered: