28

when I use 'react-native run-ios', there is some error, 'boost/operators.hpp' file not found. I can not build and run my project:

react-native-cli: 2.0.1 react-native: 0.59.9 npm: 6.9.0 yarn: 1.16.0 node: v12.4.0 os: macos 10.14.5 xcode: 10.2.1

▸ Compiling JSIDynamic.cpp

❌  /Users/lidongbo/WorkBentch/ReactNative/AwesomeProject/node_modules/react-native/React/../third-party/folly-2018.10.22.00/folly/dynamic.h:63:10: 'boost/operators.hpp' file not found

#include <boost/operators.hpp>
              ^


▸ Analyzing JSCRuntime.cpp
▸ Analyzing jsi.cpp
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening AwesomeProject.xcodeproj


project can build and run.

xclidongbo
  • 397
  • 1
  • 3
  • 7
  • looks like a dependency might need boost, try: https://stackoverflow.com/questions/104322/how-do-you-install-boost-on-macos – jman Jun 15 '19 at 23:14
  • @jman I resolve the problem. boost_1_63_0.tar.gz double-conversion-1.1.6.tar.gz folly-2018.10.22.00.tar.gz glog-0.3.5.tar.gz These files are not completely downloaded due to network reasons. – xclidongbo Jun 16 '19 at 00:19

7 Answers7

31

If you get this issue in react-native-reanimated after upgrading to react-native 0.66 update your react-native-reanimated in package.json

Try "react-native-reanimated": "2.3.0-beta.2" 

Don't forget to run yarn install or npm install to update your packages. Also do a pod install for ios and restart your server instance .

EDIT:

Support for react-native@0.66 has been officially added by react-native-reanimated@2.2.3 It is less buggy and a lot more issues have been solved.

Also check issue on github.

Hillkim Henry
  • 2,841
  • 13
  • 17
8

This might due to incomplete pods install - try deleting ios/Pods folder and run pod install under ios.

Stanley Luo
  • 3,689
  • 5
  • 34
  • 64
4

An alternative error for the same issue that I encountered was:

ios/Pods/boost-for-react-native/boost/operators.hpp:97:10: 'boost/config.hpp' file not found

To fix it, you need to clear cocoa pods and cache and re-install.

  1. Delete cocoa pods cache: rm -r ~/Library/Caches/CocoaPods
  2. Delete the Pods folder and the Podfile.lock usually located in <project_root>/ios.
  3. Reinstall pods: pod update
DBrown
  • 5,111
  • 2
  • 23
  • 24
Gabriel Bull
  • 344
  • 3
  • 8
1

You must delete cache from wherever ios concerns; Here's the process I do to clear its cache:

  1. Delete npm cache: npm cache clean --force
  2. Delete All ios temp files: cd ios && rm -r Pods/ Podfile.lock {yourProject}.xcworkspace
  3. Clear Cocoapods Cache: rm -r ~/Library/Caches/CocoaPods
  4. now install pods via npx: cd .. && npx pod-install
DBrown
  • 5,111
  • 2
  • 23
  • 24
Aexomir
  • 158
  • 8
1

So I was also getting the error boost/operators.hpp file not found but my issue was from using :path instead of :podspec in my Podfile. I'm working on an integrated RN app inside of a Native iOS app, so I was manually adding the pods to the Podfile (something I will not do from now on).

pod 'boost', :path => ...

instead of

pod 'boost', :podspec => ...

It might not be the most common fix but hoping it helps someone.

IB3N
  • 83
  • 2
  • 8
0

I resolve the problem.

boost_1_63_0.tar.gz
double-conversion-1.1.6.tar.gz
folly-2018.10.22.00.tar.gz
glog-0.3.5.tar.gz

These files are not completely downloaded due to network reasons. The file url is : {your proejct}/node_modules/react-native/scripts/ios-install-third-party.sh at lowest line.

xclidongbo
  • 397
  • 1
  • 3
  • 7
  • .sh file contain the file`s dowload url. – xclidongbo Aug 10 '19 at 02:27
  • 2
    I don't think it's network issue though. My internet is solid and retried several times, seeing the same isseu. – Stanley Luo Nov 06 '19 at 01:59
  • I retried cleaning and building multiple times. I also tried to blow out pod files and Podfile.lock and installing, and still no luck. This is not a network issue. {your proejct}/node_modules/react-native/scripts/ios-install-third-party.sh file also doesn't exist for me on RN 0.66.4 – Ilia Sidorenko Jan 19 '22 at 21:48
0

When I upgraded RN 0.64 -> 0.66, the following helped me:

  1. Delete cocoa pods cache: rm -r ~/Library/Caches/CocoaPods
  2. Delete the Pods folder and the Podfile.lock usually located in <project_root>/ios
  3. Delete Pod folder in <project_root>/ios
  4. yarn add react-native-reanimated@2.2.3
  5. pod install
Andrey Patseiko
  • 3,687
  • 1
  • 25
  • 24