我今天更新了cocoapods到1.0.0版本。我更新pod时得到了这个字符串:
[!] Invalid Podfile file: [!] The specification of link_with in the Podfile is now unsupported, please use target blocks instead..
我已删除了podFile中的link_with但我无法构建项目,因为我有很多Match-O-Linkers。任何人都知道我该如何解决这个问题?
这是我的Podfile:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
inhibit_all_warnings!
pod 'pop', '~> 1.0'
pod 'AFNetworking', '~> 1.3'
pod 'SDWebImage', '~> 3.7'
pod 'GoogleAnalytics', '~> 3'
pod 'ARAnalytics' , :subspecs => ["Crashlytics", "Amplitude", "DSL"]
pod 'FBSDKCoreKit', '~> 4.10.1'
pod 'FBSDKLoginKit', '~> 4.10.1'
pod 'FBSDKShareKit', '~> 4.10.1'
pod 'Google/SignIn'
pod 'Branch'
pod 'Leanplum-iOS-SDK'
pod 'Fabric', '1.6.7'
pod 'Crashlytics', '3.7.0'
pod 'TwitterKit'
pod 'Digits'
target 'minubeTests' do
pod 'OCMockito'
end
答案 0 :(得分:42)
试试这个。对我来说有多个目标。
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
def myPods
pod 'pop', '~> 1.0'
pod 'AFNetworking', '~> 1.3'
pod 'SDWebImage', '~> 3.7'
pod 'GoogleAnalytics', '~> 3'
pod 'ARAnalytics' , :subspecs => ["Crashlytics", "Amplitude", "DSL"]
pod 'FBSDKCoreKit', '~> 4.10.1'
pod 'FBSDKLoginKit', '~> 4.10.1'
pod 'FBSDKShareKit', '~> 4.10.1'
pod 'Google/SignIn'
pod 'Branch'
pod 'Leanplum-iOS-SDK'
pod 'Fabric', '1.6.7'
pod 'Crashlytics', '3.7.0'
pod 'TwitterKit'
pod 'Digits'
end
target 'yourTargetOne' do
myPods
end
target 'yourTargetTwo' do
myPods
end
target 'minubeTests' do
pod 'OCMockito'
end
答案 1 :(得分:30)
根据1.0版以来的新官方CocoaPods specification新模型是这样的:
请注意,
BasePods
不是项目中任何目标的实际名称。
TargetNameOne
和TargetNameTwo
是真实姓名。
platform :ios, '8.1'
inhibit_all_warnings!
abstract_target 'BasePods' do
## Networking
pod 'AFNetworking', '~> 2.6'
# Twitter
pod 'TwitterKit', '~> 1.9'
pod 'Fabric'
# Specify your actual targets
target 'TargetNameOne'
target 'TargetNameTwo'
end
编辑 - 现在Podfile
的根目录上有一个隐含的抽象目标,所以你可以将上面的例子写成:
platform :ios, '8.1'
inhibit_all_warnings!
## Networking
pod 'AFNetworking', '~> 2.6'
# Twitter
pod 'TwitterKit', '~> 1.9'
pod 'Fabric'
# Specify your actual targets
target 'TargetNameOne'
target 'TargetNameTwo'
答案 2 :(得分:2)
使用新的specification。您的所有pod包含应基于指定目标。 将您的pod文件更改为
platform :ios, '8.0'
# change minube to whatever name is of you main target
target 'minube' do
pod 'pop', '~> 1.0'
pod 'AFNetworking', '~> 1.3'
pod 'SDWebImage', '~> 3.7'
pod 'GoogleAnalytics', '~> 3'
pod 'ARAnalytics' , :subspecs => ["Crashlytics", "Amplitude", "DSL"]
pod 'FBSDKCoreKit', '~> 4.10.1'
pod 'FBSDKLoginKit', '~> 4.10.1'
pod 'FBSDKShareKit', '~> 4.10.1'
pod 'Google/SignIn'
pod 'Branch'
pod 'Leanplum-iOS-SDK'
pod 'Fabric', '1.6.7'
pod 'Crashlytics', '3.7.0'
pod 'TwitterKit'
pod 'Digits'
end
target 'minubeTests' do
pod 'OCMockito'
end