我想在iOS上使用react native进行一些基本操作,并上传到cocoapods,当我编辑xxx.podspec时,我无法指定反应和源链接的版本号。
**
**
s.ios.deployment_target = '8.0'
s.source_files = 'SCCReactNative/Classes/**/*'
# s.resource_bundles = {
# 'SCCReactNative' => ['SCCReactNative/Assets/*.png']
# }
# s.public_header_files = 'Pod/Classes/**/*.h'
# s.frameworks = 'UIKit', 'MapKit'
# s.dependency 'AFNetworking', '~> 2.3'
s.dependency 'React', :git => 'https://github.com/facebook/react-native.git', :tag => 'v0.31.0', :subspecs => [
'Core',
'RCTImage',
'RCTNetwork',
'RCTText',
'RCTWebSocket',
'ART',
'RCTActionSheet',
'RCTAdSupport',
'RCTCameraRoll',
'RCTGeolocation',
'RCTPushNotification',
'RCTSettings',
'RCTVibration',
'RCTLinkingIOS',
#'RCTTest',
]`enter code here`
**
**
[!] Invalid `SCCReactNative.podspec` file: undefined local variable or method `source' for Pod:Module.
# from /Users/huangcheng/Desktop/Project/SCCReactNative/SCCReactNative.podspec:50
# -------------------------------------------
# s.dependency 'SCCUtil'
> s.dependency 'React', source => 'https://github.com/facebook/react-native.git' ,tag => 'v0.31.0' ,subspecs => [
# 'Core',
#
任何人都可以帮助我吗?
答案 0 :(得分:0)
据我所知,您无法使用其来源指定依赖项: https://github.com/CocoaPods/CocoaPods/issues/4921
s.dependency 'React'
应该足够了
答案 1 :(得分:0)
现在,我解决了这个问题,所以我分享了这个想法。
首先将此React.podspec克隆到自己的pod中,就像这样
并将react-native标记v0.31.0 podspec写入此文件React.podspec。
所以我们可以使用
s.dependency 'React' , '0.31.0'