apollo-ios: No such module ApolloUtils

Bug report

Using the latest version of Apollo as a CocoaPod in a linked library is yielding a build error in the Apollo project:

No such module ‘ApolloUtils’

in Bundle+Helpers.swift

#if !COCOAPODS
import ApolloUtils
#endif

The import has a comment around it checking for cocoapods but the error happens anyways even though I am using cocoapods and it appears this import statement should be skipped.

Versions

Please fill in the versions you’re currently using:

  • apollo-ios SDK version: 0.50.0
  • Xcode version: 13.1
  • Swift version: 5.5.1
  • Package manager: Cocoapods 1.11.2

Steps to reproduce

Build a project using latest Apollo from cocoapods

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 21 (8 by maintainers)

Most upvoted comments

Just stopping by in this issue to say hi to @designatednerd 👋

And thank you to @icecrystal23 for submitting that fastlane PR! ❤️

Thanks for circling back to share the fix @gantaa. 👍🏻

Ok. I have found the problem. The custom configuration names that I changed for my apps needed to be exactly the same in the shared Framework. Framework having the normal ‘Debug’ and ‘Release’ configurations cause it to build successfully on its own, however caused error no such module 'Apollo' whenever I tried building one of the App targets in which the framework is used. Once I matched up all configuration names across both my apps, and my framework, all dependencies (whether I use CocoaPods or SPM) are able to build.

I am still going to use Cocoapods for now for my final solution because SPM does not play nicely with custom configuration names without additional scripting… And it appears this has been an issue for a couple years now.

Thanks for the suggestions. As expected it wasn’t an apollo-ios issue. However, I hope this thread helps others switching back and forth between SPM and Cocoapods, particularly those using custom build configurations and custom frameworks.

And remember, with apollo-ios to use the appropriate run script for your chosen package manager from the docs

Ok. So a new cloned repo, fresh pod install ends up with same error. No such module 'Apollo'

I tried downgrading to 12.5.1, but I cannot. My OS is Monterey and it only runs XCode 13+

I might switch back to SPM now. Who knows… I’ll keep you posted still