CocoaPods安装实践 2022-04-02

2022-04-03  本文已影响0人  松哥888

简介

image.png

实践过程

Step1 安装CocoaPods本身

image.png image.png

Step2 使用CocoaPods

使用 CocoaPods

image.png

可以使用vi,但是真难用。推荐使用Sublime Text,文本编辑的神器。

AFNetworking
SDWebImage
MBProgressHUD
Masonry
YYModel
YYCache
YYText
MJRefresh
DZNEmptyDataSet
WebViewJavascriptBridge

iOS常用第三方库(OC篇)

# Uncomment the next line to define a global platform for your project
platform :ios, '15.0'

inhibit_all_warnings!

target 'PandaBuy' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!

  # Pods for PandaBuy
  pod 'AFNetworking', '~> 4.0'
  pod 'SDWebImage', '~> 5.0'
  pod 'MBProgressHUD', '~> 1.2.0'
  pod 'Masonry'
  pod 'YYModel'
  pod 'YYCache'
  pod 'YYText'
  pod 'MJRefresh'
  pod 'DZNEmptyDataSet'
  pod 'WebViewJavascriptBridge', '~> 6.0'

end

You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: https://www.ruby-lang.org/bugreport.html

原因是未适配M1芯片。解决方法是执行下面的命令
sudo arch -x86_64 gem install ffi
You may have encountered a bug in the Ruby interpreter or extension libraries.

第2部分内容,出现LoadError - dlopen(...)问题的时候,参考文档的大概意思是重装ffi。不过实际试下来,感觉没有必要。只要执行一下arch -x86_64 pod install,有时候就好了。估计M1芯片带来的问题是芯片架构的问题

问题2: 连接经常中断,很不稳定

这部分内容是比较莫名其妙的,尝试了一下,也不知道是否起作用,这里只是记录一下。

cocoapods报错fatal: unable to access ‘XXX.git/‘: LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection

// 取消全局代理:
git config --global --unset http.proxy
 
git config --global --unset https.proxy

解决 Failed to connect to github.com port 443:connection timed out

感想

上一篇 下一篇

猜你喜欢

热点阅读