由于coocapods更新,最近用到cocoapods安装第三方库的时候遇到了很多的问题,其中有一个The dependency `第三方库名称` is not used in any concrete target,它的意思是这个库不属于任何target。
上网上搜索,有好多人遇到了这个问题,所以就记录一下:
解决办法:
将Podfile里面的内容改为下面的内容,保存 再pod install即可
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
target '项目名称' do
# Uncomment this line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
pod "AFNetworking"
pod "SDWebImage"
pod "SVProgressHUD"
# Pods for 项目名称
target '项目名称Tests' do
inherit! :search_paths
# Pods for testing
end
target '项目名称UITests' do
inherit! :search_paths
# Pods for testing
end
end
在最新版的cocoapods中有一个快速创建Podfile的方法
打开终端:
输入: cd 工程所在目录
然后 pod init即可生成一个Podfile
里面的内容就是上面的:
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
target '项目名称' do
# Uncomment this line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
# Pods for 项目名称
target '项目名称Tests' do
inherit! :search_paths
# Pods for testing
end
target '项目名称UITests' do
inherit! :search_paths
# Pods for testing
end
end