首先:我正在使用
Cocoapods 0.37.2,XCode 6.3.1编译iOS 8.3
在我运行基本的“pod update”之前,我的项目运行得很好,现在它完全拒绝编译.我非常肯定这与豆荚本身无关.具体来说,我得到的错误是这样的:
ld: warning: directory not found for option '-F/Users/user_name/Library/Developer/Xcode/DerivedData/AppName-bjozswzeepmhacfkeimeepxzcxgb/Build/Products/Debug-iphoneos/include' ld: library not found for -lPods-AppName-AFNetworking
Podfile是这样的:
# Uncomment this line to define a global platform for your project platform :ios,"8.0" def shared_pods pod 'SocketRocket' pod 'AFNetworking' pod 'DateTools' pod 'Spotify-iOS-SDK' end target "AppName" do shared_pods end target "AppNameTests" do shared_pods end
我已经清除了DerivedData(很多次),清理了我的构建,重新启动了XCode,重新启动了我的机器,我确保我的配置文件和链接器配置列表设置正确.我多年来一直在使用Cocoapods,从来没有遇到过这么多麻烦.
完全沮丧和困惑……质疑理智.
有帮助吗?
解决方法
来自CocoaPods
troubleshooting doc的信息.希望这对您有所帮助.
If Xcode complains when linking,e.g. Library not found for -lPods,it
doesn’t detect the implicit dependencies:
- Go to Product > Edit Scheme
- Click on Build
- Add the Pods static
library,and make sure it’s at the top of the list- Clean and build again
- If that doesn’t work,verify that the source for the spec you
are trying to include has been pulled from GitHub. Do this by looking
in /Pods/. If it
is empty (it should not be),verify that the
~/.cocoapods/master//.podspec has the correct git hub url
in it.- If still doesn’t work,check your Xcode build locations settings. Go to Preferences -> Locations -> Derived Data -> Advanced and set build location to “Relative to Workspace”.