Mit*_*iya 79 xcode ios react-native xcode15
刚刚将我的 Xcode 升级到 15.0,突然它开始在 RCT_Folly 中出现以下错误
No template named 'unary_function' in namespace 'std'; did you mean '__unary_function'?
这是失败的地方:
结构 hash_base : std::unary_function<T, std::size_t> {};
我尝试删除缓存数据和派生数据并清理构建。也尝试删除 pod 和 node_modules。但没有任何帮助。
Gre*_*een 41
运行后我在终端中收到此错误npx react-native run-ios。我通过以下步骤解决了它:
小智 39
在源文件中修复此问题之前,最好的选择是在 podfile 中添加已删除的 libcpp 函数,如此处解决的https://github.com/facebook/react-native/issues/37748#issuecomment-1580589448
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= ['$(inherited)', '_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION']
end
end
end
Run Code Online (Sandbox Code Playgroud)
Mit*_*iya 16
这有点愚蠢,但我按照__unary_functionXCode 的建议解决了这个问题。
所以实际的线路是..
结构 hash_base : std::__unary_function<T, std::size_t> {};
tet*_*tar 11
所有库必须更新其代码以使用 std::function 和 std::bind 而不是 unary_function
解决方法
选择 Pods > Build Settings > 在 Apple Clang - Preprocessing 部分 > 在 Macro 部分下
添加发布和调试 -> _LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION
ps:要添加此内容,只需单击该列,然后单击底部的“+”->然后粘贴:_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION

| 归档时间: |
|
| 查看次数: |
42322 次 |
| 最近记录: |