ld:找不到使用cocoapods的-lBolts的库

est*_*oza 5 xcode ios cocoapods bolts-framework

大家

我遇到的问题是由于出现以下错误而无法编译我的应用程序:

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

我将我的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'
Run Code Online (Sandbox Code Playgroud)

这是命令的输出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.
Run Code Online (Sandbox Code Playgroud)

我尝试过的事情:

  • 清理并重建
  • 退出xcode,清理并重建
  • 删除所有吊舱,然后重新安装,清洁和重建

Eye*_*Eye 5

我有两个问题:

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

    根据react-native

    从现在开始,YourApp.xcworkspace而不是YourApp.xcodeproj在Xcode中。

    所以我不得不切换到YourApp.xcworkspaceCocoapods生成的新文件pod init(或生成它的任何文件)。

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

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

    清理,然后构建项目。它应该工作。


est*_*oza 2

我刚刚是这样解决的:

  • 删除Pods文件夹和Podfile.lock
  • 跑步pod install
  • PodsXcode 项目上,在每个 pod 目标上,设置Build Active Architecture OnlyNo
  • 清理并再次构建