ld:未找到使用cocoapods的-lBolts的库 [英] ld: library not found for -lBolts using cocoapods

查看:140
本文介绍了ld:未找到使用cocoapods的-lBolts的库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所有人

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

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)

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

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'

这是命令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,清理并重建
  • 删除所有吊舱,然后重新安装,清洁和重建

推荐答案

我遇到了两个问题:

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

  1. The first problem was that I was building my original YourApp.xcodeproj Xcode project file.

根据 react-native :

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

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

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

react-native项目的自述文件没有提到,如果您之前已根据步骤 4将Facebook SDK添加到YourApp.xcodeprojFrameworks文件夹中.将SDK添加到 iOS版Facebook SDK –入门教程,则应删除这些引用,因为Cocoapods会将FB SDK代码提取到Pods文件夹中,因此您不再需要单独引用FB SDK.否则,Xcode会尝试根据Cocoapods的设置和说明进行构建,但会发现FB SDK的二进制文件不是"dylib".

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".

最终,您的Frameworks文件夹应该具有唯一的libPods-YourApp.a文件.

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

清洁,然后构建项目.应该可以.

Clean, then build the project. It should work.

这篇关于ld:未找到使用cocoapods的-lBolts的库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆