xcode 依赖`AFNetworking (~> 2.5)` 未在任何具体目标中使用

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/37464977/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 08:50:19  来源:igfitidea点击:

The dependency `AFNetworking (~> 2.5)` is not used in any concrete target

iosxcodegitafnetworkingcocoapods

提问by edithpiaf

I want to install AFNetworking but I have a problem, how can I fix and install? I used Getting Started with AFNetworking:

我想安装 AFNetworking 但遇到问题,我该如何修复和安装?我使用了 AFNetworking 入门

1. Download CocoaPods

1. 下载 CocoaPods

sudo gem install cocoapods
pod setup

2.a. Create a Podfile

2.a. 创建一个Podfile

touch Podfile
open -a Xcode Podfile

2.b. And copy-paste this:

2.b. 并复制粘贴这个:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '7.0'
pod 'AFNetworking', '~> 2.5'

回答by Nathan Hillyer

Add:

添加:

target 'MyApp' do
  pod 'AFNetworking', '~> 2.5'
end

See: https://guides.cocoapods.org/using/the-podfile.html

参见:https: //guides.cocoapods.org/using/the-podfile.html

Then run pod installfrom the project directory.

然后pod install从项目目录运行。