Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't find Pods.modulemap - looking in wrong directory

Tags:

I'm trying to get CocoaPods working in a Swift project but this is my first time.

My Podfile is

source 'https://github.com/CocoaPods/Specs.git' platform :ios, '8.0' use_frameworks!  pod 'Alamofire', '~> 1.2' pod 'SwiftyJSON', '~> 2.2.0' 

I run pod install but building it gives me this error:

Error: unable to read module map contents from 'Target Support  Files/Pods/Pods.modulemap': Error Domain=NSCocoaErrorDomain Code=260  "The file “Pods.modulemap” couldn’t be opened because there is no such file."  UserInfo=0x7fac488d5af0 {NSFilePath=/Users/jt/tmp-ios/my-template/Pods/Target  Support Files/Pods/Pods.modulemap, NSUnderlyingError=0x7fac457f0e90 "The operation  couldn’t be completed. No such file or directory"} 

The weird is that this is that /Users/jt/tmp-ios/ is not even the directory I am in.

Tue Jun 09$ pwd /Users/jt/repos/EmbersSwift Tue Jun 09$  

I did have something in that directory before by what it is referencing that is not clear. How would I fix this? I suspect it is something in Pods.debug.xconfig but was hoping somebody had dealt with this before.

like image 901
timpone Avatar asked Jun 10 '15 01:06

timpone


People also ask

Where can I find POD file?

The Podfile is located in the root of the Pods project. An easy way to open it is via "Open Quickly" (Shift Cmd O) typing Podfile. Show activity on this post. If it's been added to the project, you can just click on it.

What is Use_frameworks?

use_frameworks! tells CocoaPods that you want to use Frameworks instead of Static Libraries. Since Swift does not support Static Libraries you have to use frameworks.


1 Answers

The solution that worked for me was:

First step:
(this step may no longer be needed in Xcode 9.x and newer)

  1. Open Xcode
  2. Click Window (Menu Bar)
  3. Click Projects
  4. Remove all projects (e.g. use backspace)
  5. Close Xcode

Second Step:

  1. Open a terminal app
  2. cd ~/Library/Developer/Xcode/DerivedData
  3. rm -rf Build/* see below if you have a customized build location
  4. rm -rf ModuleCache/*
  5. Close a terminal app

Third Step:

  1. Open Xcode
  2. Product > Clean
  3. Product > Run

Source: https://stackoverflow.com/a/30752152/756976

If you have defined a custom build location:

  1. Go with Finder or the Terminal to the location of the build files. The location for these files is defined in Xcode. To check where these files are:
    • Open Xcode
    • Go to Settings -> Locations -> Derived Data
  2. Go to that location and delete the Build folder

Edit: June 9, 2016

It is also possible that this resolves your problem:

By default the clean of Xcode, does not delete everything, by going to Product, pressing the ALT-key, the Clean-button will change to Clean Build Folder....

like image 115
skofgar Avatar answered Oct 28 '22 15:10

skofgar