0

I want do some basic operation with react native on iOS , and upload to cocoapods , when i edit xxx.podspec , I cant Specified version number of react and source link.

**

  1. this is my 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`

**

  1. and this is error

**

[!] 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',
 #  

anyone can help me ?

2 Answers2

0

As far as I know you cannot specify a dependency using its source: https://github.com/CocoaPods/CocoaPods/issues/4921

s.dependency 'React' should be enough

Giordano Scalzo
  • 6,312
  • 3
  • 31
  • 31
0

now , i fixed this problem , so i share this idea.

first clone this React.podspec into own pod , just like this

file list

and write the react-native tag v0.31.0 podspec into this file React.podspec.

so we can use

s.dependency 'React' , '0.31.0'
Stefan Freitag
  • 3,578
  • 3
  • 26
  • 33