Linking android internal cmake libraries against a custom fabric component #234
-
Hello RN Devs, I have been stuck developing android new arch support for a fabric component. Context: I am developing support for Since the text binding code resides in the c++ shadow tree code. I had to fork some code from react native Adding custom fabric c++ code was fine, and the desired behaviour is done in iOS without problems, the only problem with android is with linking the package with CMake. Some internal cmake react native internal libraries like ( here is a glimpse of my CMakeList for the package # SETUP CODE
find_package(fbjni REQUIRED CONFIG)
find_package(ReactAndroid REQUIRED CONFIG)
add_compile_options(
-fexceptions
-frtti
-std=c++20
-Wall
-Wpedantic
-Wno-gnu-zero-variadic-macro-arguments
)
add_library(
${LIB_TARGET_NAME}
SHARED
${LIB_CUSTOM_SRCS}
${LIB_CODEGEN_SRCS}
)
target_include_directories(
${LIB_TARGET_NAME}
PUBLIC
.
${LIB_COMMON_DIR}
${LIB_ANDROID_GENERATED_JNI_DIR}
${LIB_ANDROID_GENERATED_COMPONENTS_DIR}
)
target_link_libraries(
${LIB_TARGET_NAME}
fbjni
folly_runtime
jsi
react_codegen_rncore
react_debug
react_nativemodule_core
react_render_core
react_render_debug
react_render_graphics
react_render_mapbuffer
react_render_componentregistry
# react_render_attributedstring // causes errors
# attributedstring // causes errors
react_render_textlayoutmanager
react_utils
ReactAndroid::rrc_view
ReactAndroid::rrc_text
ReactAndroid::react_render_mounting
turbomodulejsijni
yoga
)
# COMPILER OPTIONS I tried adding the whole react-native files as if they are part of my library, but of course I got the duplicate definition errors. I would love to know if someone have some experience with something similar or can at least direct us to similar-packages/guides/people who can help 🙏 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
That's because react-native-community/discussions-and-proposals#816 That library will also give you access to |
Beta Was this translation helpful? Give feedback.
That's because
attributedstring
was never exposed as a dynamic library you can depend on.I'd suggest you develop against 0.76 as there is only one library you'll have to link against:
libreactnative.so
:react-native-community/discussions-and-proposals#816
That library will also give you access to
attributedstring