Unity iOS CompileC error while building through Xcode

Hi! I’m making an iOS build for my game through command line since I have to automate builds. The Xcode weirdly gives me error related to Facebook sdk while archiving. I think there’s something related to pods not being able to install or some other thing. I’m attaching some pictures for you guys. I’ve been stuck at this for some days so any help would be much appreciated.
151602-screen-shot-2020-01-21-at-21628-pm.png
151603-screen-shot-2020-01-21-at-21831-pm.png

After updating Cocoapods 1.0.0, I deleted pod.lock and installed the current stable pod versions (4.7.0 to 4.11.0) of FBSDKCoreKit, FBSDKLoginKit, FBSDKShareKit

Then i encounter the same error. What i did was:

Added Header Search Paths Build Settings in Xcode:

"${PODS_ROOT}/Headers/Public/Facebook-iOS-SDK\"
"${PODS_ROOT}/Headers/Public/Facebook-iOS-SDK/FacebookSDK\"
"${PODS_ROOT}/Headers/Public/FBSDKCoreKit\"
"${PODS_ROOT}/Headers/Public/FBSDKCoreKit/FBSDKCoreKit\"

Then i still had error for another file. Because XCode is using prebuild frameworks.

FBSDKCoreKit/FBSDKCopying.h not found


Clean Build → ⇧⌘K (Shift + Command + K) - to clean builded frameworks.
Clean Build Folder → ⌥⇧⌘K (Option+Shift+Command+K)
Close Xcode // important! - Otherwise it recreate the DerivedData for the current open project automatically

Run this command in terminal
**rm -rf ~/Library/Developer/Xcode/DerivedData**

Open XCode and build successfully