RN在0.45版本以后,有了一些第三方庫的依賴,而且未來版本即將放棄RCTBatchedBridge,所以為了更新版本,就需要對RN和podfile進(jìn)行更新
更新前,用pod引入RN代碼如下:
react_native_path = './node_modules/react-native' ? ?
pod'yoga', :path => react_native_path + '/ReactCommon/yoga'? ??
pod 'React', :path => react_native_path, :subspecs => [ ? ? ? ? 'RCTBatchedBridge', ? ? ? ? 'Core', ? ? ? ? 'ART', ? ? ? ? 'RCTNetwork', ? ? ? ? 'RCTText', ? ? ? ? 'RCTAdSupport', ? ? ? ? 'RCTGeolocation', ? ? ? ? 'RCTWebSocket', ? ? ? ? 'RCTImage',? ? ? ? ?'RCTLinkingIOS', ? ? ? ? 'DevSupport' ? ? ]
我升級到0.49版本以后,pod引入修改如下:
react_native_path = './node_modules/react-native' ? ?
pod'yoga', :path => react_native_path + '/ReactCommon/yoga' ? ?
# Third party deps ? ?
pod 'DoubleConversion', :podspec => react_native_path + '/third-party-podspecs/DoubleConversion.podspec' ? ?
pod 'GLog', :podspec => react_native_path + '/third-party-podspecs/GLog.podspec' ? ?
pod 'Folly', :podspec => react_native_path + '/third-party-podspecs/Folly.podspec' ?? ? ? ?
pod 'React', :path => react_native_path, :subspecs => [ ? ? ? ? 'CxxBridge', ? ? ? ? 'Core', ? ? ? ? 'ART', ? ? ? ? 'RCTNetwork', ? ? ? ? 'RCTText', ? ? ? ? 'RCTAdSupport', ? ? ? ? 'RCTGeolocation', ? ? ? ? 'RCTWebSocket', ? ? ? ? 'RCTImage', ? ? ? ? 'RCTSettings', ? ? ? ? 'RCTActionSheet', ? ? ? ? 'RCTCameraRoll', ? ? ? ? 'RCTVibration', ? ? ? ? 'RCTPushNotification', ? ? ? ? 'RCTAnimation', ? ? ? ? 'RCTLinkingIOS', ? ? ? ? 'DevSupport' ? ? ]
因為CxxBridge對Folly有依賴,所以使用CxxBridge必須要引入Folly
執(zhí)行podupdate 或 pod install進(jìn)行更新就好了
注意:DoubleConversion、GLog、Folly這幾個庫在國外,最好開VPN去拉