1

I am upgrading my react native project from 0.50.4 to o.55.3(latest). After updating after npm install I am getting error as below.

No such file or directory: '{PATH}/node_modules/reactnative/ReactCommon/yoga/yoga/Yoga.c'

I checked the file directory and found out that projects which use react native version above 0.52.0 have different files yoga directory. Please check the images.(first one is <0.52.0, second one is >=0.52.0)

Before 0.52.0 After 0.52.0 How to fix the problem of can't find file Yoga.c in latest react native version?

Note: I cleaned, re installed npm modules, removed build in IOS folder and tried... nothing worked.

EDIT podfile

# Uncomment the next line to define a global platform for your project
 platform :ios, ‘9.0’

target 'ProjectName' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  #use_frameworks!

  # Pods for ProjectName

pod 'Fabric'
pod 'Crashlytics'
pod 'RSKImageCropper'
pod 'QBImagePickerController'
pod 'FreshchatSDK'
pod 'Mixpanel'

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

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



  pod 'RNShare', :path => '../node_modules/react-native-share'

  pod 'TextToSpeech', :path => '../node_modules/react-native-tts'

  pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'

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

end
Sagar
  • 484
  • 3
  • 10
  • 24

1 Answers1

2

Can you please update you Podfile including below lines, please remove current yoga pod spec. Below is for your reference, include your existing dependencies as well.

target 'Demo' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for Demo

  rn_path = '../node_modules/react-native'

  pod 'yoga', path: "#{rn_path}/ReactCommon/yoga/yoga.podspec"


pod 'React', path: rn_path, subspecs: [
    'Core',
    'CxxBridge',
    'DevSupport',
    'RCTActionSheet',
    'RCTAnimation',
    'RCTGeolocation',
    'RCTImage',
    'RCTLinkingIOS',
    'RCTNetwork',
    'RCTSettings',
    'RCTText',
    'RCTVibration',
    'RCTWebSocket',
  ]


  pod 'RNVectorIcons', :path => '../node_modules/react-native-vector-icons'

end

Do pod install again, Clean build, delete Derived Data and run iOS code from Xcode.

PPL
  • 6,357
  • 1
  • 11
  • 30
  • I tried above, BatchedBridge is causing an error while running pod install. I removed BatchedBridge and pods installed properly but I encountered "Clean Failed" message when I tried to clean. Before I used BatchedBridge to remove an error of "Argument list too long: recursive header expansion failed" error. – Sagar May 11 '18 at 11:33
  • have you removed derived data? – PPL May 11 '18 at 11:36
  • Showing All Issues Check dependencies Argument list too long: recursive header expansion failed at {ProjectPath}/node_modules/react-native-youtube/../../ios/Pods/React/node_modules/resolve/test/module_dir/zmodules/bbb. Thats the error I am getting. – Sagar May 11 '18 at 11:39
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/170852/discussion-between-sagar-and-ppl). – Sagar May 11 '18 at 12:01