简体   繁体   中英

Unable to build Project after pod init in an old xcode project

I am trying to init pod in an old code base. Whatever I do, I am not able to run my project after git init. There is always build error. I am getting following error,

ld: warning: directory not found for option '-F/Users/usr/Library/Developer/Xcode/DerivedData/MyApp-some_code/Build/Products/Debug-iphonesimulator/FBSDKCoreKit' ld: warning: directory not found for option '-F/Users/usr/Library/Developer/Xcode/DerivedData/MyApp-some_code/Build/Products/Debug-iphonesimulator/FBSDKShareKit' ld: warning: directory not found for option '-F/Users/usr/Library/Developer/Xcode/DerivedData/MyApp-some_code/Build/Products/Debug-iphonesimulator/FacebookCore' ld: warning: directory not found for option '-F/Users/usr/Library/Developer/Xcode/DerivedData/MyApp-some_code/Build/Products/Debug-iphonesimulator/FacebookShare' ld: framework not found FBSDKCoreKit

Even if my dependency pod file is empty then I get

pods framework not found.

My Framework Search Paths is set to to $(inherited), which is build/Debug-iphoneos/FBSDKCoreKit.. I have also tried to set this path to pods folder under project. But nothings works. Even I have same issue with another project also. Xcode version: 12.3 Code base is in Objective C.

I have experienced a similar problem before in the past, using FacebookSDK frameworks.

Of course, if you were using Swift, you could easily import it with Swift Package Manager .

Try to perform the following steps

1. Edit your podfile

Making explicit reference to the version and project name

pod 'FBSDKCoreKit', ‘version’ :project_name => ‘myapp’

2. Delete build data

MyApp-some_code being the appropriate folder name for your app

~/Library/Developer/Xcode/DerivedData/MyApp-some_code

3. Reinstall your pods

The command that you have probably tried a couple of times already

pod deintegrate
pod install

4. Manually add FBSDKCoreKit in Link Binary with Libraries

Navigate to Project->Targets->Build Phases->Link Binary With Libraries

From there click on the plus button and manually add the FBSDKCoreKit framework

5. Deselect copy items to destination's group folder

As per Facebook official documentation, availablehere . Check out the point number 3, in particular.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM