iOS cocoaPods新认知
最近的项目在进行pod install
之后运行报错
ld: warning: directory not found for option '-L/Users/zhangruquan/abc/ios-test-pod/Pods/build/Debug-iphoneos'
ld: library not found for -lPods-AFNetworking
clang: error: linker command failed with exit code 1 (use -v to see invocation)
奇怪的是只是today extension
项目报错,试了好多次,都没有解决,后来可能是缓存问题,于是删除xcworkspace
文件、Pods
文件夹、Podfile.lock
文件 这三项,再执行pod install
,依然不行。突然想起,之前today extension
项目中的项目依赖库都是手动配置的,可能在这有问题。于是更新Podfile
文件
platform :ios, '7.0'
def pods
pod 'AFNetworking', '~> 2.0'
pod 'UALogger'
pod 'Mantle'
end
target 'testPodToday' do
pods
pod 'MBProgressHUD'
pod 'ReactiveViewModel'
pod 'UMengAnalytics-NO-IDFA'
end
target 'News' do
pods
end
这时会收到一些警告
然而打开项目xcworkspace 运行,仍然报错
ld: warning: directory not found for option '-L/Users/zhangruquan/abc/ios-test-pod/Pods/build/Debug-iphoneos'
ld: library not found for -lPods-AFNetworking
clang: error: linker command failed with exit code 1 (use -v to see invocation)
天呐。这可咋办,我这时候想到之前的手动配置可能出现了影响,以至于改了Podfile
还是不行,能不能把整个项目的pod配置重新清理一遍呢
这里是答案链接
###如下:需要两个工具
1、Cocoapods-Deintegrate Plugin
2、Cocoapods-Clean Plugin
###那么这两个工具如何安装呢
1、Cocoapods-Deintegrate Plugin:终端中输入
gem install cocoapods-deintegrate
2、Cocoapods-Clean Plugin:终端中输入
gem install cocoapods-clean
###如何使用 1、首先在控制台输入
cd (path of the project) //Remove the braces after cd
2、 然后
pod deintegrate
3、
pod clean
最后确保两个项目中的
other link flags
、header search paths
、 library search paths
、PODS_ROOT
均为空即可
###
pod install
再运行 就不会有啥问题了
Written on March 21, 2016