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

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.

I just had this issue and it happens when you have incompatible versions of Flipper pods.
This worked for me:
Update your Podfile to install Flipper like this:
use_flipper!({ 'Flipper' => '0.93.0', 'Flipper-Folly' => '2.6.7', 'Flipper-DoubleConversion' => '3.1.7' })
Update deployment target on both Podfile and Xcode project o 12.1 or newer:
platform :ios, '12.1'
Remove Podfile.lock
pod install --repo-update
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.

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)

Instead of giving him the precise version I used the next line:
use_flipper!
Put it in Podfile and run: pod install --repo-update.
It worked for me!

Related

ld: library not found for -lDoubleConversion React Native 0.62.2 when "Archive" in Xcode but I can build and run my app with Xcode

When I do archive build, I got the following error. This has been discussed on stackOverflow before. But most of them are the case that the error happens at debug/build level. I don't have problems with build/run. Also, I tried everything I possibly can but none of them helps.
Here is how I get this error:
1) rm -rf node_modules
npm install
cd ios
pod install
2) open MyAppName.xcworkspace with Xcode.
3) Product -> Archive.
some more info about my setup:
in my Podfile, DoubleConversion lib is there.
pod 'DoubleConversion', :podspec => "#{rnPrefix}/third-party-podspecs/DoubleConversion.podspec"
from Xcode, this lib DoubleConversion is also linked
Does anyone can give me some suggestion?

Xcode, Pods ProjectName.debug.xcconfig unable to open file. Wrong directory

When I build project, I see build error: ProjectName.debug.xcconfig unable to open file. I couldn't understand my problem for a long time, but today I take attention, what directory is wrong: full error: projectName/Pods/Pods...ProjectName.debug.xcconfig unable to open file Where Pods part duplicated, so correct directory must be as projectName/Pods...ProjectName.debug.xcconfig How to fix it?
Xcode 10.1
After trying other suggestions found here #8091 (comment) and at Incorrect path for Pods.debug.xcconfig in Xcode?
I found that Kaspik's suggestion worked:
pod deintegrate
pod install
edit the .xcodeproj/project.pbxproj file and change the PBXGroup "path = Pods" to "name = Pods"
source https://github.com/CocoaPods/CocoaPods/issues/8091
updated from: pod reintegrate to: pod deintegrate
I have encored with this solution...Here is how I solved
Close Xcode,
run on terminal "pod install"
open xcode,
clean build folder and run again
Remove the duplicates from the Pods folder ƒrom xcode project here:
Deleting extra files in target->Linked Frameworks and Libraries solved my problem
Do the following
Delete .xcworkspace file
Go to project build phases - delete Check Pods Manifest.lock and Embed Pods Framework section
Remove Pods folder from the left project navigator
Remove Pods folder from the project directory
Delete everything related to pods except Podfile
Do Pod install
This should resolve the problem.
Run pod repo update first and then you should be able to install pods with yarn install:pods if you're using yarn.
I was able to manage by reopening Xcode, in my case i had already run pod install with the ide open (Xcode 12.0).
Clean build folder. Then use the code following:
pod reintegrate
pod install
I ran into this issue in CI. Simply running xcodebuild clean fixed it for me.
In Xcode that'd be equivalent to cmd + shift + k.
I was getting the same issue, I checked my npm modules was corrupted so I deleted npm modules
And npm install ==> cd iOS ==> pod install.
And the code works smoothly!
Happy coding!
Better solution for further this kind of issues
$ cd ~/.cocoapods/repos
$ git clone https://github.com/CocoaPods/Specs.git master

Swift - Unable to open file in target Xcode 10

I am trying to run Aplication which I have downloaded from GitHub.
When I run get error unable to open file in target, I have Xcode 10.
I already searched for solution and get this one.
I had the same problem, but in Xcode 6.1.1 - what fixed it for me was to change the configuration file setting to None for the two Pods-related targets, then run pod install again.
The configuration file setting is found by selecting the project (not the target) and then the Info tab.
But cant find configuration file location.
Here is the error picture:
https://i.stack.imgur.com/Ql3M5.png
In File -> Project setting -> select Legacy Build System
Make sure you have opened .xcworkspace file and pod installed properly.
A solution I found to work for me was
Inside the project root directory
root
|- <ProjectName>
|- <ProjectName>.xcodeproj
|- <ProjectName>.xcworkspace
|- <ProjectName>Tests
|- Podfile
|- Podfile.lock
|- Pods
Delete the following files. Ensure you have copied the contents of Podfile.
Podfile
Podfile.lock
Pods Folder
Open your .xcodeproj using Xcode or using terminal command
open <ProjectName>.xcodeproj
Inside Xcode, locate the "Pods" folder which should contain something along the lines of...
Pods
|- Pods-<ProjectName>.debug.xconfig
|- Pods-<ProjectName>.release.xconfig
Delete those references and select "move to trash" when prompted.
Close Xcode
Now run the following:
pod init && pod install
Open your Podfile and paste in your previously copied old Podfile that was deleted earlier.
run the following command:
pod install
In terminal open Xcode again with the following command
open <ProjectName>.xcworkspace
Note: that I opened the xcworkspace file NOT the xcodeproj file.
At this point for me I was able to compile my code as normal without having to change back to the Legacy Build System.
Reinstall the pods to get everything cleaned up:
pod deintegrate
pod cache clean --all
pod install
This happened due to change the Project Name or Miss the Pods from Your Project
if the Pods are Miss Then Following Method
open the Project and Command + Shift + K
Close the Project
Open Terminal got to Your Xcode Project Directory cd /your-Xcode-project
if coca pods are already installed so skip this Point if not sudo gem install cocoa pods run this Command on terminal
pod install
If Above Method not Working so its Project name Issue then Go with following Method
First, open your Pod File and change the target
target 'your Xcode project name' do
run the Following Commands from Terminal
go to Your directory from terminal
pod deintegrate
pod clean
pod install
Done now open your xcWorkSpace file
For me it works, update the version of CocoaPods and reinstall the pods
sudo gem install cocoapods
Run following commands after you have downloaded Xcode project from GitHub:
cd /your-xcode-project
pod install
This worked on Xcode 10.2.
I had this issue too with project I cloned from GitLab. Your error looks extremely similar to mine. I solved it by running this in Terminal:
cd path/to/your/project
pod install
When I checked project folder in Finder, there was a Podfile. But same project viewed in Xcode had nothing under 'Pods' module. From this I figured out the pods are not installed (or installed properly?) and installing them solved this error.
If there is some Pods or .xcworkspace file, it might be worth doing pod deintegrate before installation - just to be sure :)
I was facing the same error opening an old project in a new macbook with a recent installation of Xcode and no cocoa pods or anything related on it.
My way to fix this was following some of the steps en the issues #1727 of alamofire and change some things. Open the terminal and cd project where the pod file is.
So, this is what worked for me:
sudo gem install cocoa pods
pod repo remove master
pod setup
pod repo update
pod install
Then just, clean build folder and build the project.
Quit Xcode
Open Terminal
Change to directory (where podfile is present)
pod install
I was trying to do pod install after removing unwanted pod(steps 2,3 & 4), but it still was not working. Quitting Xcode (steps 1, 2, 3 & 5) worked.
If you suddenly start seeing this issue on an existing project, before you try anything else, try
pod update
Make sure your pod build settings looks good
Clean build folder
Retry building
1-
in xcode
menu --> project --> clean build files
2-
close project
3-
in terminal
cd
4-
in terminal
pod update
5-
re-open
project..xcworkspace file
6-
clean, build
good luck
delete file name "Podfile.lock" and try pod install again.
Just stumbled into the issue recently myself. It seems it's a bug in CocoaPods.
Possible fix: gem install cocoapods --pre
I tried below and error went away !!
project name - SwiftExample
Went to Pods -> Info -> Configurations -> Debug
Change to None for Pods-SwiftExample
Code compiles even after setting it back to original.
I can see many solutions already given there. But I believe the easiest way to resolve this problem is
Open the project directory in Terminal
Delete .xcworkspace file
Run pod install
That's it. The newly created .xcworkspace file will work without any problem.
Open your project file (project.pbxproj) and check of 'Pods' is added to the path before the 'Target Support Files' folder. Remove that and i got it to build fine.

framework not found GoogleMapsCore Error

I'm using cocoapods in my project and I have googlemaps(2.5.0) and googleplaces(2.5.0) in my podfile(which I've installed with 'pod install').
However, I'm getting this error when I try to build:
ld: framework not found GoogleMapsCore
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I've changed 'Build Active Architecture Only' to NO in my Build Settings. I'm also in my project.xcworkspace NOT my project.xcodeproj file. I've even tried changing my valid architectures but none of this is working.
It might be helpful to note that, inside my workspace Project Navigator, for some reason I have my project.xcodeproj file in red. project.xcodeproj is usually never there let alone red.
Finally a solution:
pod deintegrate
pod install
I had to reclone my Git project(because I had tried too many solutions to backtrack through new warnings and errors) then I just did the above commands in terminal.
Though #Sam King's solution worked for me, I considered it as a hard fix without knowing the actual issue.
The issue for my case was, I had accidentally deleted the GoogleMapsCore framework(Might be from 'Manage System Storage').
So, I just checked out an older version of my app and the issue got fixed.
For those using Ionic Framework,
Remove googlemap plugin and install again. It worked for me.
Had the same problem after deleting GoogleMapsCore by mistake. and here's what worked for me:
From my project podfile , commented out the pods related to google maps, in my case
//rn_maps_path = '../node_modules/react-native-maps'
// pod 'react-native-google-maps', :path => rn_maps_path
// pod 'GoogleMaps'
// pod 'Google-Maps-iOS-Utils'
cd ios && pod install , to remove the pods i commented out
then i uncommented the pods i have commented earlier in step 1
cd ios && pod install to install the pods again
ran a clean build on xcode and it worked.
Remove googlemap related plugin and install again. It worked for me.
Please dont do deintegrate pod, if you do all libraries get install as new, that some how some libraries would not support your platform.
The better solution is to install the google places along with the GoogleMaps pod it will definitely work
Try this
pod 'GoogleMaps'
pod 'GooglePlaces'
if it doesn't work then open the terminal and do this below steps for your project
pod deintegrate
pod install
then
pod 'GoogleMaps'
pod 'GooglePlaces'

Pod files not showing up on Xcode

Anyone ever have their pod files not show up in their pod files?
Here is how my project's pods looks
and here is how they used to look:
I have ran 'pod install' and it says everything is downloaded so I'm kinda at a loss. the error I am getting is error: No such module "Kingfisher"
EDIT:
Ok, so this kind of turns in to a different question. I had the .xcproject instead of the .xcworkspace. But I thought I had it backwards because when I open my workspace It keeps looking like this, and I can't open anything.
In my case I did
pod init
and the Podfile got created (can see from terminal and finder) but not showing on currently opened Xcode project.
So, then I edited the Podfile with nano from terminal to install specific pods I need. Then I did:
pod install
And I got this message:
[!] Please close any current Xcode sessions and use `FoodTracker.xcworkspace` for this project from now on.
Pod installation complete! There is 1 dependency from the Podfile and 5 total pods installed.
Closing current project then re-open with new .xcworskpace will solve the issue.

Resources