gpt4 book ai didi

ios - AFNetworking cocoapods 为 WatchOS 2 扩展构建失败

转载 作者:搜寻专家 更新时间:2023-11-01 05:39:11 28 4
gpt4 key购买 nike

我正在尝试使用 Cocoapods 和包括 AFNetworking 的 Xcode 7.0 为 WatchOS 2 构建一个 Swift WatchKit 应用程序,据我所知,它支持 2.6.0 版的 watchOS2...

我已经完全恢复到一个空项目,该项目仅包含一个 watch 扩展目标并尝试导入 AFNetworking:

enter image description here

播客文件:

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 {

}

在 Pod 中构建失败 > AFNetworking > AFNetworking.h,错误:

AFURLSessionManager.h file not found

enter image description here

查看生成的 Pods 项目,似乎 AFNetworking pod 只包含少量文件(并且据报道,缺少 AFURLSessionManager,以及看起来像很多其他文件的文件):

enter image description here

我是不是漏掉了什么?

  • 这是 pod 中的错误还是我在 Podfile 中遗漏了什么?
  • 我是否遗漏了build设置中的某些内容? (我在现有项目中遇到了同样的问题,所以尝试了一个具有默认build设置的全新项目,并得到了同样的错误)。

提前致谢。

最佳答案

podspec ( https://github.com/CocoaPods/CocoaPods/issues/4208 ) 有问题

解决此问题的最简单方法是直接使用存储库,直到推送 2.6.1 podspec。

pod 'AFNetworking', :git => 'https://github.com/AFNetworking/AFNetworking.git', branch: 'master'

关于ios - AFNetworking cocoapods 为 WatchOS 2 扩展构建失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32809631/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com