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

标签 ios xcode cocoapods bolts-framework

大家

我遇到的问题是我无法编译我的应用程序,因为我收到以下错误:

ld: library not found for -lBolts
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我的 XCode 项目配置为使用 cocoapods,这是我的 pod 列表:

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'

这是命令 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.

我尝试过的事情:

  • 清理和重建
  • 退出xcode,清理并重建
  • 删除所有 pod 并重新安装、清理和重建

最佳答案

我有两个问题:

  1. 第一个问题是我正在构建我的原始 YourApp.xcodeproj Xcode 项目文件。

    根据 react-native :

    From now on open YourApp.xcworkspace instead of YourApp.xcodeproj in Xcode.

    所以我不得不切换到 Cocoapods 在 pod init 上生成的新 YourApp.xcworkspace(或任何生成它的东西)。

  2. react-native 项目的 README 没有提到如果您之前将 Facebook SDK 添加到 YourApp.xcodeprojFrameworks 文件夹根据步骤4。将 SDK 添加到 Facebook SDK for iOS - Getting Started 的 Xcode 项目教程,那么你应该删除那些引用,因为 Cocoapods 会将 FB SDK 代码拉到 Pods 文件夹中,所以你不再需要单独引用 FB SDK。否则,Xcode 会尝试根据 Cocoapods 的设置和说明进行构建,但发现 FB SDK 的二进制文件“不是 dylib”。

    最终,您的 Frameworks 文件夹应该只有一个 libPods-YourApp.a 文件。

    清理,然后构建项目。它应该有效。

关于ios - ld : library not found for -lBolts using cocoapods,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34257951/

相关文章:

ios - 线程 1 : signal SIGABRT error on Obj C

xcode - 在localizable.strings中添加“换行符”

xcode - MKStoreKit 错误

ios - 在 Xcode 4.3 中为应用商店分发捆绑应用

iOS - 在我的自定义框架中使用第三方库

cocoapods - 找不到名称、作者、摘要或描述与 `xxx` 匹配的 Pod

ios - 自动调整 UILabel 文本大小以适合 UILabel 宽度

ios - 核心数据复杂关系

ios - 您的二进制文件未针对 iPhone 5 进行优化,LaunchImage {320,568}

ios - 从 Cocoa Touch 框架创建 CocoaPod