xCode:未找到库 - lPods-Bolts - 退出代码 1
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26794422/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
xCode: Library not found - lPods-Bolts - Exit Code 1
提问by mmk88
Hi I'm having this issue:
您好,我遇到了这个问题:
ld: library not found for -lPods-Bolts
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ld:找不到用于 -lPods-Bolts 的库
clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)
However, I downloaded the Bolt package from the Facebook Docs and put it into my supporting files. In addition, I'm using Cocoapods so I also downloaded Bolt using Cocoapods.
但是,我从 Facebook Docs 下载了 Bolt 包并将其放入我的支持文件中。另外,我使用的是 Cocoapods,所以我也使用 Cocoapods 下载了 Bolt。
Ld /Users/mmk88/Library/Developer/Xcode/DerivedData/Jobazo-gejnfogovpyqypgovssmomabbuhl/Build/Products/Debug-iphoneos\ /Jobazo.app/Jobazo normal arm64
cd /Users/mmk88/Desktop/Jobazo
export IPHONEOS_DEPLOYMENT_TARGET=8.1
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
-arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk
-L/Users/mmk88/Library/Developer/Xcode/DerivedData/Jobazo-gejnfogovpyqypgovssmomabbuhl/Build/Products/Debug-iphoneos\
-F/Users/mmk88/Library/Developer/Xcode/DerivedData/Jobazo-gejnfogovpyqypgovssmomabbuhl/Build/Products/Debug-iphoneos\
-F/Users/mmk88/Desktop/Jobazo/Pods/Parse -F/Users/mmk88/Desktop/Jobazo/Pods/Parse-iOS -F/Users/mmk88/Desktop/Jobazo/Pods/ParseFacebookUtils -F/Users/mmk88/Documents/FacebookSDK -F/Users/mmk88/Desktop/Jobazo/Jobazo -filelist /Users/mmk88/Library/Developer/Xcode/DerivedData/Jobazo-gejnfogovpyqypgovssmomabbuhl/Build/Intermediates/Jobazo.build/Debug-iphoneos/Jobazo.build/Objects-normal/arm64/Jobazo.LinkFileList
-Xlinker -rpath -Xlinker @executable_path/Frameworks -dead_strip -ObjC -lPods-Bolts -lPods-Facebook-iOS-SDK -lPods-JSMessagesViewController -lPods-JSQSystemSoundPlayer -lPods-Parse -lPods-Parse-iOS -lPods-ParseFacebookUtils -lsqlite3 -lz -framework AudioToolbox -framework CFNetwork -framework CoreGraphics -framework CoreLocation -framework Foundation -framework MobileCoreServices -framework Parse -framework ParseFacebookUtils -framework QuartzCore -framework Security -framework StoreKit -framework SystemConfiguration -framework UIKit -weak_framework Accounts -weak_framework AdSupport
-weak_framework AudioToolbox -weak_framework CoreGraphics -weak_framework CoreLocation -weak_framework Foundation -weak_framework QuartzCore -weak_framework Security -weak_framework Social -weak_framework UIKit -fobjc-arc -fobjc-link-runtime
-miphoneos-version-min=8.1 -lPods-JSQMessagesViewController -framework AudioToolbox -framework QuartzCore -framework Bolts -lPods-Bolts
-lPods-Facebook-iOS-SDK -lPods-JSMessagesViewController -lPods-JSQSystemSoundPlayer -lPods-Parse-iOS -lPods-Parse -lPods-ParseFacebookUtils -lPods -Xlinker -dependency_info -Xlinker /Users/mmk88/Library/Developer/Xcode/DerivedData/Jobazo-gejnfogovpyqypgovssmomabbuhl/Build/Intermediates/Jobazo.build/Debug-iphoneos/Jobazo.build/Objects-normal/arm64/Jobazo_dependency_info.dat -o /Users/mmk88/Library/Developer/Xcode/DerivedData/Jobazo-gejnfogovpyqypgovssmomabbuhl/Build/Products/Debug-iphoneos\ /Jobazo.app/Jobazo
Podfile:
播客文件:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '6.0'
pod 'Parse-iOS'
pod 'ParseFacebookUtils'
pod 'JSMessagesViewController'
pod 'Bolts'
回答by Daniel Galasko
Typically this can happen sometimes when one of your pod dependencies is accidentally added to the Build Phases pane under "Link Binary With Libraries" of your Targets settings.
通常,当您的 pod 依赖项之一意外添加到目标设置的“将二进制文件与库链接”下的构建阶段窗格时,有时会发生这种情况。
Removing the library ".a" file from the Build Phase should do the trick.
从构建阶段删除库“.a”文件应该可以解决问题。
回答by Andrea.Ferrando
My problem was that I changed the name of the project, so I reinstalled pods and in "Link Binary With Libraries" I had to delete "libPods-(old_pods_name).a" and also "Bolts.framework" and "Restkit.framework". Then reinstalled pods That worked for me!!!
我的问题是我更改了项目的名称,所以我重新安装了 pods,在“Link Binary With Libraries”中,我不得不删除“libPods-(old_pods_name).a”以及“Bolts.framework”和“Restkit.framework” . 然后重新安装豆荚这对我有用!!!
回答by AechoLiu
I resolved this problem, by switching scheme
to Pods-xxx
, and build it first. Then, switch back to original project, and build it.
我解决了这个问题,通过切换scheme
到Pods-xxx
,并首先构建它。然后,切换回原始项目,并构建它。
Let Pods-xxx
build the necessary xxx.a first, resolve the dependency problem.
先Pods-xxx
构建必要的xxx.a,解决依赖问题。
Switch scheme
切换方案
On the toolbar, select
在工具栏上,选择
Product -> Scheme -> (Pods-xxx or original target)
Product -> Scheme -> ( Pods-xxx or original target)