iOS Pod集成RN环境

第一步:把完整的node_modules文件夹复制到项目目录中去;

第二部:在Profile中加入:(注意下面的path跟你项目文件夹中node_modules路径一致)

    pod 'React', :path => './node_modules/react-native', :subspecs => [

            'Core',

            'CxxBridge', # Include this for RN >= 0.47

            'DevSupport', # Include this to enable In-App Devmenu if RN >= 0.43

            'RCTActionSheet',

            'RCTGeolocation',

            'RCTImage',

            'RCTNetwork',

            'RCTPushNotification',

            'RCTSettings',

            'RCTText',

            'RCTVibration',

            'RCTWebSocket',

            'RCTAnimation',

            'RCTBlob',

            'RCTLinkingIOS',

        ]

        pod'yoga', :path => './node_modules/react-native/ReactCommon/yoga'

        # 如果RN版本 >= 0.45则加入下面三个第三方编译依赖

        pod'DoubleConversion', :podspec => './node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'

        pod'glog', :podspec => './node_modules/react-native/third-party-podspecs/glog.podspec'

        pod'Folly', :podspec => './node_modules/react-native/third-party-podspecs/Folly.podspec'

第三步:执行 pod install (如果提示路径找不到,请检查上面的path跟你项目文件夹中node_modules路径一致)

第四步:编译Project  (如果node_modules完整,编译应该是OK的)

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容