Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

fatal error: 'boost/preprocessor/control/expr_iif.hpp' file not found

I have a React Native project. I recently updated to macOS Big Sur 11.3 and XCode Version 12.5 (12E262).

When I build the project in XCode I get the following error:

../ios/Pods/Headers/Public/Flipper-Folly/folly/functional/Invoke.h:22:10: fatal error: 'boost/preprocessor/control/expr_iif.hpp' file not found
#include <boost/preprocessor/control/expr_iif.hpp>
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

When I browse to Pods folder, expr_iif.hpp file exists.

I tried removing Pods folder, Podfile.lock, .xcworkspace. Deleted npm cache. Then ran pod install.

But no luck.

This build-time error is thrown by Flipper-RSocket and Flipper-Folly.

I can provide further details if requested.

like image 658
Evgin Avatar asked Apr 30 '21 20:04

Evgin


2 Answers

I just had this issue and it happens when you have incompatible versions of Flipper pods.

This worked for me:

  1. Update your Podfile to install Flipper like this:
use_flipper!({ 'Flipper' => '0.93.0', 'Flipper-Folly' => '2.6.7', 'Flipper-DoubleConversion' => '3.1.7' })
  1. Update deployment target on both Podfile and Xcode project o 12.1 or newer:
platform :ios, '12.1'
  1. Remove Podfile.lock
  2. pod install --repo-update
  3. Close and re-open the Xcode project

You may also try fixing permissions if the above is not enough for you:

chmod -R 755 ios/Pods/boost-for-react-native

The error went away after this.

like image 107
Bruno Lemos Avatar answered Nov 10 '22 12:11

Bruno Lemos


It completely removes Flipper, but here's a workaround I used

  • disabled Flipper in PodFile (as explained in an answer here: React Native Project is not running on iOS Simulator)
  • deleted Pods directory
  • re-ran npx pod-install
  • started the application (npx react-native run-ios)
like image 1
beedub Avatar answered Nov 10 '22 12:11

beedub