美文网首页
react-native 关于启用use_frameworks!

react-native 关于启用use_frameworks!

作者: 老王技术栈 | 来源:发表于2023-11-28 17:30 被阅读0次

在App中启用use_frameworks!之后 导致原生端为react-native 提供的swift插件编译错误问题


App-Swift.h错误展示 启用use_frameworks之后的other_swift_flags

重新构建一个react-native工程发现原生工程端发现 other_swfit_flags这个配置在启用use_frameworks! 跟不启用存在很大问题。所以推测在启用use_frameworks之后,cocoapods 就把React的swift模块功能禁用了,目前不清楚为什么这么做。


react-native正常工程的other_swfit_flags

既然分析出来问题,那么尝试解决,一通查找之后发现React-Core.modulemap文件,添加到other_swfit_flags中就完事。果然编译通过了!

-Xcc
-fmodule-map-file="${PODS_ROOT}/Target Support Files/React-Core/React-Core.modulemap"

把上面的代码添加到swfit_other_flags就可以编译通过了


如图

希望能帮助到需要的人

相关文章

网友评论

      本文标题:react-native 关于启用use_frameworks!

      本文链接:https://www.haomeiwen.com/subject/cxkxgdtx.html