在归档时,我在Xcode云测试中出现了错误。
所有问题都与CocoaPods依赖相关:
unable to open file (in target "Alamofire" in project "Pods")
missing module map file: '/Volumes/workspace/repository/Pods/Target Support Files/Alamofire/Alamofire.modulemap
看来在存档时没有安装吊舱。
在当地效果很好。
最好的
发布于 2021-12-14 07:50:25
发布于 2021-12-21 06:31:06
Xcode云临时构建环境不包括第三方工具(如CocoaPods )。但您可以使用后克隆脚本将它们包括在内。下面是使用CocoaPods的步骤。
ci_scripts目录。ci_post_clone.sh并将其保存在ci_scripts目录中。Terminal并使脚本可执行在ci_scripts目录中运行chmod +x ci_post_clone.sh。ci_post_clone.sh并复制以下内容。!/bin/sh#安装CocoaPods,使用Homebrew。brew安装CocoaPods #安装您使用cocoapods管理的依赖关系。吊舱安装ci_post_clone.sh。发布于 2022-09-30 14:52:21
文档中建议的设置方法非常糟糕--它没有版本控制,通过brew进行安装需要很长时间。最好的方法是拥有一个Gemfile,它在回购的根部声明依赖项,即:
source 'https://rubygems.org'
gem 'cocoapods'
gem 'fastlane'然后通过bundle install将工具的版本锁定在Gemfile.lock上(您应该在回购中对这两个文件进行版本化)。
在您的ci_scripts/ci_post_clone.sh文件中:
#!/bin/sh
#1 - You can't install gems to the system gem path without sudo, so create a local one
echo ">>> SETUP LOCAL GEM PATH"
echo 'export GEM_HOME=$HOME/gems' >>~/.bash_profile
echo 'export PATH=$HOME/gems/bin:$PATH' >>~/.bash_profile
export GEM_HOME=$HOME/gems
export PATH="$GEM_HOME/bin:$PATH"
#2 - Install the actual bundler version you bundled locally with, so you don't have any surprises
echo ">>> INSTALL REQUIRED BUNDLER VERSION"
gem install bundler -v "$(grep -A 1 "BUNDLED WITH" ../Gemfile.lock | tail -n 1)" --install-dir $GEM_HOME
#3 - Let bundler download the locked version of cocoapods, fastlane, and whatever other tools you need
echo ">>> INSTALL DEPENDENCIES"
bundle install
#4 - Finally you can run the bundled pod binary to install your dependencies
echo ">>> INSTALL PODS"
bundle exec pod install另外,考虑使用Pods文件夹来避免运行cocoapods。或者至少只给出较大的二进制文件(例如Twilio、WebRTC等)。这还可以保护您免受删除的repos或脱机服务提供程序的影响。
https://stackoverflow.com/questions/70334519
复制相似问题