Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix cocoapod .modulemap file not found

When I try to build my project, I get a compile time error saying that a "Module map file" for my pod cannot be found and that I am missing a "SwiftShimes" module.

This is weird because all my modulemap files are where they should be when I install my pods.

I am using Xcode 10.2 and Cocoapods 1.6.1.

I have tried the following ->

  • deintegrating cocoapods from my project
  • cleaning the project
  • deleted ModuleCache and DerivedData
  • restarting my computer

This is the type of error I am getting ->

Module map file '/Users/kaunamohammed/Library/Developer/Xcode/DerivedData/OutNow-gxdxvzwmnijmrlajtbtyclkhrgqs/Build/Products/Debug-iphoneos/CodableFirebase/CodableFirebase.modulemap' not found

I expect my project to build properly but this is not the case and I am not sure what else to do.

This is what my Podfile looks like

platform :ios, '10.0'

workspace 'OutNow'

target 'OutNow' do
  use_modular_headers!
  #Pods for OutNow
  pod 'Instabug'
  pod 'SwiftMessages'
  pod 'CodableFirebase'
  pod 'Firebase/Core'
  pod 'Firebase/Auth'
  pod 'Firebase/Storage'
  pod 'Firebase/Firestore'
  pod 'Firebase/Messaging'
  pod 'Firebase/DynamicLinks'
  pod 'MarqueeLabel/Swift'
  pod 'RxSwift', '4.4.2'
  pod 'RxCocoa', '4.4.2'
  pod 'Kingfisher', '5.3.1'
  pod 'InstantSearchClient', '6.0'
  pod 'CoordinatorLibrary', '1.0.5'
  pod 'UIScrollView-InfiniteScroll', '1.1.0'

  target 'OutNowTests' do
    inherit! :search_paths
    # Pods for testing
  end

end
like image 672
Kauna Mohammed Avatar asked Apr 14 '19 13:04

Kauna Mohammed


3 Answers

In case it helps anyone else, I was able to solve this issue a different way. I was accidentally opening up my .xcproject instead of my .xcworkspace. When I opened the correct file, the error went away.

like image 122
Eric Wiener Avatar answered Nov 07 '22 22:11

Eric Wiener


I fixed this problem myself. I can tell you what I did. Not sure which steps did it exactly, but below are all steps:

  1. Copy the contents of your Podfile somewhere safe
  2. Run: pod cache clean --all
  3. Remove "Podfile"-file from the dir.
  4. Xcode: Product > Clean Build Folder
  5. Run: pod init. A new "Podfile"-file is added to the dir
  6. Start adding parts of your original Podfile to this file
  7. Run: pod install
  8. Try to build your project again

In my case, I think the row use_frameworks! in the "Podfile" did the trick.

Hope this help you guys out!

like image 46
Ton Snoei Avatar answered Nov 07 '22 23:11

Ton Snoei


I had this issue only when I wanted to make an archive. On the other hand, debug worked fine. After a while I noticed that min iOS version was different between my Target, Project and Podfile min iOS version. After syncing them all to same value (iOS 11) Xcode offered me Validate Project Settings - Update to recommended settings option which I accepted and I was able to archive my project.

like image 34
Josip B. Avatar answered Nov 07 '22 22:11

Josip B.