iOS Failed to connect to github.com port 443: Operation timed out

从git上pull完iOS项目之后,在项目工程里终端命令执行pod install
报错诸如以下错误:
1.错误:

Analyzing dependencies
Downloading dependencies
Installing AFNetworking (3.1.0)

[!] Error installing AFNetworking
[!] /usr/bin/git clone https://github.com/AFNetworking/AFNetworking.git /var/folders/5z/1pd1v4ns1gjdhqmbmv83zwzh0000gn/T/d20210528-84046-m7bk3p --template= --single-branch --depth 1 --branch 3.1.0

Cloning into '/var/folders/5z/1pd1v4ns1gjdhqmbmv83zwzh0000gn/T/d20210528-84046-m7bk3p'...
fatal: unable to access 'https://github.com/AFNetworking/AFNetworking.git/': 

pod install后.png

解决:打开hosts文件,sudo vi /etc/hosts屏蔽github.com比如我的是

#192.30.255.113  github.com

报错2:
运行工程运行会报:/Pods/Target Support Files/xxx/xxx.xcconfig: unable to open file (in target

解决:在项目中的TARGETS->Build Phases[CP] Copy Pods Resources[CP] Embed Pods Frameworks删掉报错所提示的文件或者点击右边x整个删除即可。

简示.png

你可能感兴趣的:(iOS Failed to connect to github.com port 443: Operation timed out)