问题
everybody
The problem that I am having is that I can't compile my app because I got the following error:
ld: library not found for -lBolts
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I have my XCode project configured to use cocoapods and this is my list of pods:
pod 'Google/Analytics', '~> 1.0.0'
pod 'AFNetworking', '~> 2.0'
pod 'XCDYouTubeKit', '~> 2.4.0'
pod 'FBSDKCoreKit'
pod 'FBSDKShareKit'
pod 'FBSDKLoginKit'
pod 'Parse'
pod 'ParseUI'
pod 'ParseFacebookUtilsV4'
pod 'ParseTwitterUtils'
This is the output of the command pod install
:
Updating local specs repositories
Analyzing dependencies
Downloading dependencies
Installing AFNetworking (2.6.3)
Installing Bolts (1.5.0)
Installing FBSDKCoreKit (4.8.0)
Installing FBSDKLoginKit (4.8.0)
Installing FBSDKShareKit (4.8.0)
Installing Google (1.0.7)
Installing GoogleAnalytics (3.14.0)
Installing GoogleNetworkingUtilities (1.0.0)
Installing GoogleSymbolUtilities (1.0.3)
Installing GoogleUtilities (1.1.0)
Installing Parse (1.10.0)
Installing ParseFacebookUtilsV4 (1.9.1)
Installing ParseTwitterUtils (1.9.1)
Installing ParseUI (1.1.7)
Installing XCDYouTubeKit (2.4.1)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There are 10 dependencies from the Podfile and 15 total pods installed.
Things that I have tried:
- Clean and rebuild
- Exit xcode, clean and rebuild
- Delete all pods and re-install, clean and rebuild
回答1:
I had two problems:
The first problem was that I was building my original
YourApp.xcodeproj
Xcode project file.According to react-native:
From now on open
YourApp.xcworkspace
instead ofYourApp.xcodeproj
in Xcode.So I had to switch to the new
YourApp.xcworkspace
generated by Cocoapods onpod init
(or whatever generated it).The README of
react-native
project doesn't mention that if you have previously added Facebook SDK intoYourApp.xcodeproj
'sFrameworks
folder according to the step 4. Add the SDK to your Xcode Project of Facebook SDK for iOS - Getting Started tutorial, then you should remove those references, because Cocoapods will pull the FB SDK code intoPods
folder, so you no longer need to reference FB SDK separately. Otherwise, Xcode tries to build according to the settings and instructions of the Cocoapods, but finds FB SDK which has binaries that are "not adylib
".Eventually, your
Frameworks
folder should have the onlylibPods-YourApp.a
file.Clean, then build the project. It should work.
回答2:
I just solved this way:
- Delete
Pods
folder andPodfile.lock
- Run
pod install
- On
Pods
project of Xcode, on every pod target, setBuild Active Architecture Only
toNo
- Clean and build again
回答3:
I was integrating MFSideMenu
in my demo app and getting same error.
Solution work for me is below
Build phases -> Link Binary With Library -> add new -> then select libXYZ.a
from workspace (in my case its libMFSideMenu.a
) -> add it. Clean project and buils again
回答4:
Follow the below steps,
- Removed
-l"bolts"
from Other Linker Flags(Project -> Build Settings -> Linking -> Other Linker Flags)
- Have a clean build
NB: If you can't find it easily you can search in Workspace,
回答5:
In my case I needed to re install pods with below commands from Podfile
directory,
pod deintegrate
pod install
And then build after clearing deriveddata folder
If it does not work follow the answer here
来源:https://stackoverflow.com/questions/34257951/ld-library-not-found-for-lbolts-using-cocoapods