Module not found error when importing Swift pod into Objective-C project Module not found error when importing Swift pod into Objective-C project swift swift

Module not found error when importing Swift pod into Objective-C project


In my existing project, I did #include Charts-Swift.h in my project's main.m file and this solved problem from me. @import Charts worked perfectly now. This was done according to the instructions that are written in Apple documentation here.

I made a new project and tried Anni S's answer, this time I built the project with cmd+B before writing any import statement and it worked too. I guess building it once after installing pod and before importing any module is necessary.


I tried the same step what you mentioned in the comment however I was not getting the error that you got. My project simply builds and runs. Steps that I followed:

  1. Create Objective-C single view project.
  2. Added 'Podfile' in the project directory level (Podfile should be at the xcodeproject file level) and add following lines
use_frameworks!pod 'Charts'
  1. Close xcodeproject
  2. Go to project directory and run the 'pod install' command from the termial
  3. Open workspace i.e. .xcworkspace file
  4. Import charts file in view controller such as

#import "ViewController.h" @import Charts;


I found the reason why it works for new project, but for an existing project.

In the project settings, delete the value of the Other Linker Flags property.

This is the most case that most developers are being missed.