iOS build fails randomly on xcodebuild script step for cocoapods project

Description of the issue

I have iOS build workflow designated to create apple docs with jazzy.
Workflow description:

  1. pod install step (always working fine)
  2. script step to install jazzy gem (always working fine)
  3. script step to build docs for scheme#1 (randomly fails)
  4. script step to build docs for scheme#2 (randomly fails)

Script steps to build docs for schemes look like this:
jazzy -c -o docs/SDK -x -workspace,SDK.xcworkspace,-scheme,SDK --min-acl public
jazzy itself invoke xcodebuild to build the docs

These script steps fail randomly with error:

DerivedData/SDK-afhonkjkzymabegjvlljtkhlofwx/Index/DataStore -index-system-modules
    /Users/vagrant/git/SDK/Model/CardInfo.swift:10:8: error: no such module 'Bender'
    import Bender

Bender is one of the pods added during the pod install step.

Stranger thing is that Immediate rebuild will fix the issue for a couple of builds but eventually it will fail with the same message again.

Reproducibility

  • Does a “Rebuild” help? (You can trigger a rebuild from the Build’s page, by clicking the “Rebuild” button in the top right corner of a finished build) : YES
  • Does a rebuild without caches help? (You can remove the Cache:Pull and Cache:Push steps temporarily to not to use the cache, or you can delete all the caches on the Settings tab of the app. : NO
  • Does the issue happen sporadically, or every time? : Sporadically

Local reproduction

Can it be reproduced on your own Mac/PC by following our [local debug guide] - NO

Thank you!

In case someone will face same strange behaviour, seems that my issue is related to podfile configuration and especially to this cocoa pods feature:
https://rubydoc.info/gems/cocoapods/Pod/Installer/InstallationOptions#deduplicate_targets-instance_method

Looks like my podfile was bit messy, and some pod targets are deduplicated with each pod install action. After cleaning up my podfile (every pod mentioned only once now) Bitrise build working fine.

There is also old GitHub post with similar issue:
https://github.com/CocoaPods/CocoaPods/issues/4034

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.