【发布时间】:2015-12-24 21:45:26
【问题描述】:
我正在尝试为 Xcode 7.0 的 WatchOS 2 构建一个 Swift WatchKit 应用程序,使用 Cocoapods 并包括 AFNetworking,据我所知,它支持 2.6.0 版的 watchOS2...
我已经恢复到一个空项目,它只包含一个监视扩展目标并尝试导入 AFNetworking:
Pod 文件:
source 'https://github.com/CocoaPods/Specs.git'
workspace 'AFNetworkingTest.xcworkspace'
target "WatchApp Extension" do
use_frameworks!
platform :watchos, '2.0'
pod 'AFNetworking'
end
配置 cocoapods:
$ pod --version
0.38.2
$ pod install
Updating local specs repositories
CocoaPods 0.39.0.beta.4 is available.
To update use: `gem install cocoapods --pre`
[!] This is a test version we'd love you to try.
For more information see http://blog.cocoapods.org
and the CHANGELOG for this version http://git.io/BaH8pQ.
Analyzing dependencies
Downloading dependencies
Installing AFNetworking (2.6.0)
Generating Pods project
Integrating client project
Sending stats
ExtensionDelegate.swift:
import WatchKit
import AFNetworking
class ExtensionDelegate: NSObject, WKExtensionDelegate {
}
在 Pods > AFNetworking > AFNetworking.h 中构建失败,出现错误:
AFURLSessionManager.h 文件未找到
查看生成的 Pods 项目,AFNetworking pod 似乎只包含少数文件(据报道,缺少 AFURLSessionManager,以及看起来像很多其他文件):
我在这里遗漏了什么吗?
- 这是 pod 中的错误还是我在 Podfile 中遗漏了什么?
- 我是否遗漏了构建设置中的某些内容? (我在现有项目中遇到了同样的问题,所以尝试了一个使用默认构建设置的全新项目,并得到了同样的错误)。
提前致谢。
【问题讨论】:
标签: ios swift afnetworking cocoapods watchkit