将本地模块作为可可豆荚的一部分

时间:2019-05-21 09:41:54

标签: react-native cocoapods react-native-ios cocoapods-1.2

我必须在react native中创建一个framework模块,该模块必须通过cocoapod分发。

我为React Library创建了podspec并添加了React作为依赖项。 现在,在我的实际本机应用程序中,当我尝试使用Framework时,并没有提取所有依赖项。

我在一些博客中看到建议将 Core,CxxBridge,DevSupport,RCTText 作为子规范的一部分,该子规范具有如下所示的本地引用。

pod 'React', :path => 'reactNative/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
    'RCTText',
    'RCTNetwork',
    'RCTWebSocket', # needed for debugging
]
# Explicitly include Yoga if you are using RN >= 0.42.0
pod "yoga", :path => "reactNative/node_modules/react-native/ReactCommon/yoga"

# Third party deps podspec link
pod 'DoubleConversion', :podspec => 'reactNative/node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
pod 'glog', :podspec => 'reactNative/node_modules/react-native/third-party-podspecs/glog.podspec'
pod 'Folly', :podspec => 'reactNative/node_modules/react-native/third-party-podspecs/Folly.podspec'

使用上述方法,我们无法作为框架分发,因为它指向node_module中存在的所有依赖项podspec的本地引用。

有人可以帮我分发执行所需的所有反应依赖项的框架

0 个答案:

没有答案