每个人
我遇到的问题是我无法编译我的应用程序,因为我收到以下错误:
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.
我尝试过的事情:
解决方法
我有两个问题:
>第一个问题是我正在构建我原来的YourApp.xcodeproj Xcode项目文件.
根据react-native
:
From now on open
YourApp.xcworkspace
instead ofYourApp.xcodeproj
in Xcode.
所以我不得不切换到由pod init(或任何生成它)的Cocoapods生成的新的YourApp.xcworkspace.
> react-native项目的自述文件没有提到如果您之前已经根据步骤4将Facebook SDK添加到YourApp.xcodeproj的Frameworks文件夹中.将SDK添加到您的Xcode Project of Facebook SDK for iOS – Getting Started教程,那么您应该删除这些引用,因为Cocoapods会将FB SDK代码拉入Pods文件夹,因此您不再需要单独引用FB SDK.否则,Xcode会尝试根据Cocoapods的设置和指令进行构建,但会找到包含“不是dylib”的二进制文件的FB SDK.
最终,您的Frameworks文件夹应该只有libPods-YourApp.a文件.
清理,然后构建项目.它应该工作.