CI Issue: no such module 'AWSCore' only when running remotely

Hi all,

I appreciate that this post is essentially a stackoverflow “pls help” post but I thought you guys would be a little better equipped to lend a hand.

I’ve had a weird issue on my iOS CI pipeline, and I think it’s been happening ever since…

  • Upgrading my local machine to MacOS Montery Beta (12)
  • Upgrading to Xcode 13 (I was using the beta until now). I’m now on 13.1

The Bitrise stack is set up to use MacOS Big Sur and Xcode 13.0.

The archive step is failing due to the following error:

❌ /Users/vagrant/Library/Developer/Xcode/DerivedData/Carbn-aytoffoummsttefoksamtqdxyipu/SourcePackages/checkouts/amplify-ios/AmplifyPlugins/Core/AWSPluginsCore/Auth/AWSAuthService.swift:10:8: no such module 'AWSCore'

I’m using AWS Amplify with Swift Package Manager as a dependency, and I haven’t changed anything about it since long before this was broken.

When I try to run my code and create archives on my local device, it works fine - I have not been able to recreate this error anywhere except on Bitrise.

I’m at a loss to how to proceed - any help will be hugely appreciated since the lack of CI is slowing down our dev/test/release cycles pretty badly!

Thanks again,

Jacob

UPDATE:

I fixed the AWSCore problem - I both re-installed the SPM package and added $(BUILD_PRODUCT_DIR) ------ recursive to my framework search paths.

I now have this error:

❌  /Users/vagrant/git/App/Carbn/Application/App Coordinator/Flows/AppCoordinator+HomeFlow.swift:19:8: no such module 'Challenges'
import Challenges
        ^

Challenges is a feature module in my project. I recently renamed it, but made sure there is no trace of the previous name anywhere in the project. I got 20 of the above error (I think everywhere that imports it) and the following other warning:

⚠️  /Users/vagrant/Library/Developer/Xcode/DerivedData/Carbn-aytoffoummsttefoksamtqdxyipu/Build/Intermediates.noindex/ArchiveIntermediates/Carbn-Test/IntermediateBuildFilesPath/Carbn.build/Testing-iphoneos/Carbn.build/Objects-normal/arm64/AppCoordinator+FlowDelegate.dia:1:1: Could not read serialized diagnostics file: error("Invalid diagnostics signature") (in target 'Carbn' from project 'Carbn')
Command CompileSwift failed with a nonzero exit code
       ^

I solved this now - I’ll keep it here for posterity.

I hadn’t renamed the FOLDER (separate from the Xcode project) to the new module name. Changing this solved everything.

Update here - I keep intermittently getting this issue.

I think the true cause was the Cache Pull build step - it seemed to be getting some old version of the cache which was incompatible with the existing build.

Every time I remove the Cache Pull step, the build works, but is a lot slower (and prone to timeout on release builds). When I put it back, the build fails due to the AWSCore import error.

Is there a way to erase/reset the cache? Completing a build does not seem to do the trick.

Hello @Jacob_Bartlett

Thanks for sharing your findings so others can benefit from your experience! :slight_smile:
You can delete your accumulated cache in your App’s Settings tab, if you scroll down to Manage Build Caches (BETA).

Hope this helps!