HarmonyOS鸿蒙Next中RN打Release包报error: undefined symbol: folly::f14::detail::kEmptyTagVector
HarmonyOS鸿蒙Next中RN打Release包报error: undefined symbol: folly::f14::detail::kEmptyTagVector
打release包报如下错:
error: undefined symbol: folly::f14::detail::kEmptyTagVector
3 回复
【解决方案】
目前很多三方库的开发都会引入folly的头文件,所以三方库的包编译需要加上folly的相关配置。
target_compile_options(rnoh_reanimated PUBLIC ${folly_compile_options})
target_compile_options(rnoh_safe_area PUBLIC ${folly_compile_options})
更多关于HarmonyOS鸿蒙Next中RN打Release包报error: undefined symbol: folly::f14::detail::kEmptyTagVector的实战系列教程也可以访问 https://www.itying.com/category-93-b0.html
这是React Native在HarmonyOS Next上编译时的常见链接错误,主要原因是Folly库的符号未正确链接。以下是解决方案:
- 确保项目中使用的RN版本与HarmonyOS Next兼容
- 检查build.gradle中的依赖配置:
implementation 'com.facebook.folly:folly:2021.07.22.00'
- 在CMakeLists.txt中添加Folly链接:
find_library(folly folly)
target_link_libraries(your_target PRIVATE folly)
- 如果使用预编译库,请确保NDK版本与Folly兼容
这个问题通常出现在RN 0.68+版本,因为该版本开始使用F14哈希表实现。建议同步更新React Native和Folly到最新稳定版本。