安装 Alamofire pod 时出现名称冲突错误

Conflicting names error when installing Alamofire pod

我创建了一个带有手表和今日扩展程序的应用程序 运行 Xcode 8.2.1。 with Swift 3. 对于所有目标,我想使用 Alamofire 来启动请求。这与 iOS 应用程序和 Watch Extension 完美配合,但 pod install 在尝试将其添加到今天的目标时抛出以下错误:

The 'Pods-xY' target has frameworks with conflicting names: alamofire.

这是我的播客文件:

target 'xY' do
  use_frameworks!
  pod 'Alamofire', '~> 4.4'
end

target 'xYToday' do
  use_frameworks!
  pod 'Alamofire', '~> 4.4'
end

target 'xYWatch Extension' do
  use_frameworks!
  pod 'Alamofire', '~> 4.4'
end

我 运行 遇到了同样的问题,就在今天。显然不可能在今天的扩展和应用程序中使用相同的框架。参见 this comment

Cocoapods 应该给出一个不错的错误消息,这是一个错误,但目前,只有 Apple 可以像你我所期望的那样修复这个问题,参见 this comment by the same guy later in the thread

糟透了!