Problem 1: 如果 Mac 是 M1芯片 的话,通过 pod install 进行安装会报错,提示 You may have encountered a bug in the Ruby interpreter or extension libraries ,解决方法如下:
sudo arch -x86_64 gem install ffi
arch -x86_64 pod install
Problem 2: 在安装过程中出现 LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443 以及 Failed to connect to github.com port 443 : Operation timed out 错误,问题的原因可能是:(1) 网络不好、(2)porxy设置不正确或没有设置。再后来初始化 gRPC-Core 时,更是一大片的 fatal ,同样是上述的两个错误,为了方便查看其初始化的具体过程,采取以下办法:
arch -x86_64 pod install --verbose
然后通过设置代理(针对 github.com),发现有了很大进展,基本上都能成功,代理设置命令如下:
git config --global http.https://github.com.proxy socks5://127.0.0.1:1080
但是问题还是出现了,Failed to clone 'third_party/libFuzzer' ,具体的原因是 failed to connect to chromium.googlesource.com port 443: Operation timed out ,这下是google的资源获取不了,然后发现可能还是代理设置的问题,于是再设置一个 Http 代理:
git config --global http.proxy http://127.0.0.1:1087
其中,端口1080和1087的设置是因为在Mac上配置的V2Ray中,指定的Sock监听端口是1080、Http监听端口是1087。
以上设置成功之后,就可以成功安装了~
Problem 3: 当 pod install 成功后,通过命令 open ScanningApp.xcworkspace 打开自己的项目,却无法导入 Firebase,具体的原因如下所示:
[!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target `ScanningApp` to `Target Support Files/Pods-ScanningApp/Pods-ScanningApp.release.xcconfig` or include the `Target Support Files/Pods-ScanningApp/Pods-ScanningApp.release.xcconfig` in your build configuration (`Configuration/SampleCode.xcconfig`).
[!] CocoaPods did not set the base configuration of your project because your project already has a custom config set. In order for CocoaPods integration to work at all, please either set the base configurations of the target `ScanningApp` to `Target Support Files/Pods-ScanningApp/Pods-ScanningApp.debug.xcconfig` or include the `Target Support Files/Pods-ScanningApp/Pods-ScanningApp.debug.xcconfig` in your build configuration (`Configuration/SampleCode.xcconfig`).
以上描述的是在自己的 project 中已经存在相关配置,CocoaPods无法再对其进行配置。解决办法如下:
将箭头指向的配置先修改为 None,然后再在文件目录中执行 arch -x86_64 pod install 命令,最后生成的结果就是上图箭头所示。接着便能够在自己的项目中导入 Firebase 了~
参考资料: (1)https://stackoverflow.com/questions/26287103/cocoapods-warning-cocoapods-did-not-set-the-base-configuration-of-your-project?rq=1 (2)https://github.com/dxil/Blog/issues/3 (3)https://github.com/GoogleCloudPlatform/ios-docs-samples/issues/43 (4)https://gist.github.com/laispace/666dd7b27e9116faece6 (5)https://www.jianshu.com/p/5d6e1942dfb1
|