集成的详细步骤可以参考:https://reactnative.cn/docs/0.51/integration-with-existing-apps.html#content
遇到的问题,
1,pod install时,名字不匹配,
[!] The name of the given podspec `yoga` doesn't match the expected one `Yoga`
[!] The name of the given podspec `glog` doesn't match the expected one `GLog`
解决办法:直接改动podfile文件的名字即可2.pod install报错
[!] Unable to find a specification for `boost-for-react-native` depended upon by `Folly`
解决办法: 弄个VPN pod update
3,could not build module 'yoga', 'algorithm' file not found
解决办法: 这个是cocoapods的问题,只需要在文件 'node_modules/react-native/ReactCommon/yoga/yoga.podspec' 加入下行代码
spec.public_header_files = 'yoga/Yoga.h', 'yoga/YGEnums.h', 'yoga/YGMacros.h'
如下
# Set this environment variable when not using the `:path` option to install the pod.
# E.g. when publishing this spec to a spec repo.
source_files = 'yoga/**/*.{cpp,h}'
source_files = File.join('ReactCommon/yoga', source_files) if ENV['INSTALL_YOGA_WITHOUT_PATH_OPTION']
spec.source_files = source_files
# Only expose the needed headers
spec.public_header_files = 'yoga/Yoga.h', 'yoga/YGEnums.h', 'yoga/YGMacros.h'
end
本文介绍了在使用React Native进行应用集成过程中遇到的几个常见问题及其解决方案,包括pod安装时名称不匹配、pod安装失败及'yoga'模块构建失败等问题。
4645

被折叠的 条评论
为什么被折叠?



