1

I'm facing this No such module 'SomeModule' error in an XCode solution that I've inherited from some other developers. Initially the error is No such module 'ObjectMapper', but I find that if I swap the position of that line with the one below, it becomes No such module 'Alamofire'.

I've tried all the simple things suggested on this site (and others), making sure I'm opening the .xcworkspace file, deleting everything and re-installing (derived data, the whole Pods directory, etc.), updating cocoapods, etc.

I suspect that what's actually going on is that either the pods themselves aren't building, but for some reason the errors there are making their way to XCode's obtuse errors list, or that they are building but somehow not being linked correctly.

This is actually a project I've inherited from some other developers, so it's hard to know what weird or wonderful configuration they've done to break things. They are using an approach that I've not seen before where there's 3 build schemes for different environments (in this case Develop, Stage and Prod) then this kind of parent scheme for all the other three.

I've also tried going to 'Manage Schemes' then ticking the 'Show' checkbox for the Pods-Sunflower project. When I try to build just that project, I get a bunch of errors (mainly for Facebook, Google and Realm pods) that say things like:

Unable to load contents of file list: '/Target Support Files/FBSDKCoreKit/FBSDKCoreKit-xcframeworks-input-files.xcfilelist'

I don't expect anyone will be able to provide me a set of steps on how to solve this issue (I mean, that would be great), but I am hoping that someone can help me find ways to just work out what the problem is here, like:

  • How can I verify that all the separate pods are actually building?
  • Is there some folder where I can see all the built pods?
  • When you get a No such module 'SomeModule' error, where is Xcode trying to find the modules (like, in the file system? where?)

Thanks. I know this is one of those perennial issues, appreciate any advice.

Mick Byrne
  • 14,394
  • 16
  • 76
  • 91
  • 1
    FWIW, I've had this problem when using cocoapods and then running the project on the simulator on a Apple silicon (e.g., M1) machine. If you (or future readers) have this specific problem, try building for device and see if it works. If it works on physical device and not simulator, see [this answer](https://stackoverflow.com/q/63607158/1271826). In my case, excluding arm64 for the simulator, as outlined in that answer, worked for me. – Rob Apr 01 '23 at 16:22

1 Answers1

1

The solution which worked for me was:

  1. First thing i do when i got project from another developer is make a copy of pods and completely delete following files
  • Podfile
  • Pods folder
  • Podfile.lock
  • xcworkspace
  1. In case you already once use that same project try deleting derived data
  2. After deleting pods, reinstall pods and open project and let xcode do indexing of your project and after indexing look left side where warnings and errors shows, In there sometime you just have to just click and update or convert whatever xcode suggesting.

Note: - Sometimes doing same thing doesn't work try changing sequence because its xcode sometimes become dumb. Also try restarting

  • Honestly in these situation all i do is hit and try. But above steps generallt works for me.
Mr. Sagar
  • 61
  • 1
  • 2