Xcode Cloud Testing fails to archive project

Viewed 867

I have errors with Xcode cloud testing while archiving.

Issues are all related to CocoaPods dependencies:

unable to open file (in target "Alamofire" in project "Pods")

missing module map file: '/Volumes/workspace/repository/Pods/Target Support Files/Alamofire/Alamofire.modulemap

Looks like pods are not being installed on archiving.

It works well locally.

Best,

2 Answers

Xcode Cloud temporary build environment doesn't include third party tools like CocoaPods. But you can include them using post clone script. Here are the steps if you are using CocoaPods.

  1. Create a directory ci_scripts at the root of your project.

  2. Add a file ci_post_clone.sh and save it in the ci_scripts directory.

  3. Open Terminal and make your script executable be running chmod +x ci_post_clone.sh in ci_scripts directory.

  4. Edit the ci_post_clone.sh in any text editor and copy the following.

     # !/bin/sh
    
     # Install CocoaPods using Homebrew.
     brew install cocoapods
    
     # Install dependencies you manage with CocoaPods.
     pod install
    
  5. Commit and push ci_post_clone.sh.

Related