24

我正在使用 CocoaPods 安装 AFNetworking 库。这是我的简单 CocoaPods 文件:

platform :ios
pod 'FMDB'
pod 'AFNetworking'

我的 Pods 项目和我的主项目是 iOS 6 部署目标和基础 SDK。当我运行 pod install 时,出现以下错误:

AFNetworking not compatible with iOS 4.3

更新:

我将我的 Podfile 编辑为:

platform :ios, '6.0'
pod 'FMDB'
pod 'AFNetworking'

现在,当我运行 pod install 时,它显示以下内容:

更新规范 repo `master'

Cocoapods 0.15.1 可用。

使用 AFNetworking (1.0) 使用 FMDB (2.0) 生成支持文件

但它从未将 AFNetworking pod 添加到 xCode 中的 pods 项目中。

4

2 回答 2

31

AFNetworking 1.0 及更高版本需要 iOS 5.0 及更高版本,或 Mac OS 10.7(具有现代 Cocoa 运行时的 64 位)及更​​高版本。

为了与 iOS 4.3 兼容,请使用最新的 0.10.x 版本。

来自: https ://github.com/AFNetworking/AFNetworking :

更新,在 Podfile 中指定 iOS 依赖项:

platform :ios, '6.0'

pod 'FMDB'
pod 'AFNetworking'

更新 2,我创建了一个新项目和一个新 Podfile,运行pod install

$ pod install
Resolving dependencies of `./Podfile'
Updating spec repositories
Resolving dependencies for target `default' (iOS 6.0)
Downloading dependencies
Installing AFNetworking (1.0)
Installing FMDB (2.0)
Generating support files

[!] From now on use `AF.xcworkspace'.
Integrating `libPods.a' into target `AF' of Xcode project `./AF.xcodeproj'.

更新 3,

截屏

于 2012-10-19T02:24:15.780 回答
14

指定所需 pod 的版本可能会有所帮助。

platform :ios, '6.0'
pod 'FMDB', '~> 2.0'
pod 'AFNetworking', '~> 1.1.0'

还要确保您打开了正确的xcworkspace文件。

于 2012-11-22T22:56:10.360 回答