• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

ios - ld: library not found for -lBolts using cocoapods

[复制链接]
菜鸟教程小白 发表于 2022-6-1 20:09:46 | 显示全部楼层 |阅读模式 打印 上一主题 下一主题

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


Best Answer-推荐答案


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.

回复

使用道具 举报

懒得打字嘛,点击右侧快捷回复 【右侧内容,后台自定义】
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关注0

粉丝2

帖子830918

发布主题
阅读排行 更多
广告位

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap