ld: library not found for -lBolts using cocoapods

笑着哭i 提交于 2019-11-26 14:53:52

问题


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:

  1. 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 of YourApp.xcodeproj in Xcode.

    So I had to switch to the new YourApp.xcworkspace generated by Cocoapods on pod init (or whatever generated it).

  2. The README of react-native project doesn't mention that if you have previously added Facebook SDK into YourApp.xcodeproj's Frameworks 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 into Pods 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 a dylib".

    Eventually, your Frameworks folder should have the only libPods-YourApp.a file.

    Clean, then build the project. It should work.




回答2:


I just solved this way:

  • Delete Pods folder and Podfile.lock
  • Run pod install
  • On Pods project of Xcode, on every pod target, set Build Active Architecture Only to No
  • 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,

  1. Removed -l"bolts" from Other Linker Flags (Project -> Build Settings -> Linking -> Other Linker Flags)
  2. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!