Can't find Pods.modulemap - looking in wrong directory
The solution that worked for me was:
First step:
(this step may no longer be needed in Xcode 9.x and newer)
- Open Xcode
- Click Window (Menu Bar)
- Click Projects
- Remove all projects (e.g. use backspace)
- Close Xcode
Second Step:
- Open a terminal app
cd ~/Library/Developer/Xcode/DerivedData
rm -rf Build/*
see below if you have a customized build locationrm -rf ModuleCache/*
- Close a terminal app
Third Step:
- Open Xcode
- Product > Clean
- Product > Run
Source: https://stackoverflow.com/a/30752152/756976
If you have defined a custom build location:
- 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
- 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...
.
error: unable to read module map contents from 'Target Support Files in iOS
Xcode might be using another projects project path, even though your project is a new project. Closing Xcode and deleting the xcode preferences from ~/Library/Preferences/ might fix the issue.
Add import to module_map or umbrella header
By the way, I found the solution! /p>
I created the custom umbrella header — MyPod/Sources/MyPod-umbrella.h
.
And added imports of pods which I want to be available with import MyPod
:
@import MyAnotherPod;
Then I created the custom modulemap — MyPod/MyPod.modulemap
:
framework module MyPod {
umbrella header "MyPod-umbrella.h"
export *
}
And finally in ./MyPod.podspec
:
# Add MyPod-umbrella.h to sources
s.source_files = "#{s.name}/Sources/**/*.{swift,h}"
# Select custom module map
s.module_map = "#{s.name}/#{s.name}.modulemap"
After these changes I just can write:
import MyPod
// And it also imports MyAnotherPod like
// import MyAnotherPod
Related Topics
Swift - Resolving a Math Operation in a String
How to Store 1.66 in Nsdecimalnumber
How to Get a Reference to the App Delegate in Swift
Load a Uiview from Nib in Swift
How to Save and Read Array of Array in Nsuserdefaults in Swift
Overriding Superclass Property With Different Type in Swift
Setting Device Orientation in Swift Ios
How to Get Ip Address in Swift
Swift Protocol Extension Method Is Called Instead of Method Implemented in Subclass
How to Add Type Constraints to a Swift Protocol Conformance Extension
Share Data Between Main App and Widget in Swiftui For iOS 14
Biginteger Equivalent in Swift
How to Use Special Character in Nsurl
String Value to Unsafepointer≪Uint8≫ Function Parameter Behavior
What Are the New "For", "At", "In" Keywords in Swift3 Function Declarations