@环境配置遇到的error
@操作步骤
1.确定环境是好的,若还有未安装的请先安装
pod search YTKNetwork
若是可以使用,会出现对应版本。结果如下
pod search YTKNetwork
YTKNetwork is a high level request util based on AFNetworking.
pod 'YTKNetwork', '~> 2.0.4'
- Homepage: https://github.com/yuantiku/YTKNetwork
- Source: https://github.com/yuantiku/YTKNetwork.git
- Versions: 2.0.4, 2.0.3, 2.0.2, 2.0.1, 2.0.0, 1.3.0, 1.2.0, 1.1.0, 1.0.0,
0.6.0, 0.5.0, 0.4.0, 0.3.0, 0.2.0, 0.1.0 [master repo]
-> YTKNetwork+MoerFinance (2.0.4.2)
YTKNetwork is a high level request util based on AFNetworking.
pod 'YTKNetwork+MoerFinance', '~> 2.0.4.2'
- Homepage: https://github.com/MoerFinance/YTKNetwork
- Source: https://github.com/MoerFinance/YTKNetwork.git
- Versions: 2.0.4.2, 2.0.4.1 [master repo]
-> YTKNetwork-uploadProgress (3.0.1)
YTKNetwork is a high level request util based on AFNetworking.
pod 'YTKNetwork-uploadProgress', '~> 3.0.1'
- Homepage: https://github.com/welcommand/YTKNetwork-uploadProgress
- Source: https://github.com/welcommand/YTKNetwork-uploadProgress.git
- Versions: 3.0.1 [master repo]
··· //省略更多
end
2.再起一个终端,创建一个Podfile文件(先cd应用根目录位置)
touch Podfile //创建
open -e Podfile //此时将打开一个空文件
3.再Podfile文件写入需要的第三方库(以YTKNetwork为例),记得保存后关闭
//未使用官方镜像,使用清华大学镜像
source ‘https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git’
target 'MyNote1042' do
pod 'YTKNetwork', '~> 2.0.4'
//此处添加更多
end
4.在终端输入
pod install
下载文件需要过一会,显示如下说明成功
Analyzing dependencies
Downloading dependencies
Installing AFNetworking (3.2.1)
Installing YTKNetwork (2.0.4)
Generating Pods project
Integrating client project
[!] Please close any current Xcode sessions and use `name.xcworkspace` for this project from now on.
Sending stats
Pod installation complete! There is 1 dependency from the Podfile and 2 total pods installed.
[!] Smart quotes were detected and ignored in your Podfile. To avoid issues in the future, you should not use TextEdit for editing it. If you are not using TextEdit, you should turn off smart quotes in your editor of choice.
[!] Automatically assigning platform `ios` with version `12.4` on target `MyNote1042` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
如提示,需要关闭xcode,你打开project须要双击 .xcworkspace 这个project,而不是之前的xcodeproj。
5.在此打开项目