【发布时间】:2016-11-22 15:05:07
【问题描述】:
我正在尝试从 0.39 迁移到最新版本的 CocoaPods。这是我原来的 podfile:
platform :ios, '10.0'
use_frameworks!
target 'MyApp' do
pod 'SwiftyJSON'
pod 'Alamofire', '~> 4.0'
pod 'AlamofireImage', '~> 3.1'
end
target 'MyAppWatchKitApp' do
end
target 'MyAppWatchKitApp Extension' do
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '3.0'
end
end
end
在阅读了CocoaPods 1.0 Migration Guide 和this StackOverflow post 之后,我尝试更新我的 podfile:
platform :ios, '10.0'
target 'MyApp' do
use_frameworks!
pod 'SwiftyJSON'
pod 'Alamofire', '~> 4.0'
pod 'AlamofireImage', '~> 3.1'
target 'MyAppWatchKitApp' do
end
target 'MyAppWatchKitApp Extension' do
end
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '3.0'
end
end
end
保存 podfile,在终端中运行pod update,然后打开并构建项目,我看到以下错误(客户端名称被审查,替换为“MyApp”以匹配上面的 pod 文件):
我尝试过的其他事情:
- 除了
pod update之外,还做一个pod install - 删除派生数据
我在 Swift 和 Xcode 方面有一些很好的经验,但 pod 对我来说仍然相对较新。也许我错过了一些非常基本的东西。非常感谢任何帮助!
【问题讨论】: