'MWCommon.h' file not found

143 Views Asked by At

I am working on an old project written in Objective-C and its minimum deployment version is iOS 13.0. Recently I've updated the libraries using pod and now the project is showing the error 'MWCommon.h' file not found in the line #import "MWCommon.h" Here's my pod-file:

#platform :ios, '13.0'

target '<project-name>' do
  use_frameworks!
  project '<project-name>.xcodeproj'
  
  pod 'GoogleMaps', '~> 6.2.1'
  pod 'SDWebImage'
  pod "MWPhotoBrowser"
  pod 'MBProgressHUD'
  
end

I've also executed the following commands and cleaned the build folder to solve this issue but it didn't work.

pod deintegrate
pod cache clean --all
pod install

Also, as you can see in the following screenshot, MWCommon.h exists in app -> pods -> MWPhotoBrowser.

Screenshot of folder tree of pod

What can I do to make the project run again?

2

There are 2 best solutions below

2
Rob Napier On

You almost certainly want to replace this:

#import "MWCommon.h"

with this:

#import <MWPhotoBrowser/MWCommon.h>

You may need to apply similar changes to any other Pods. They're part of modules, so you want to use the <...> syntax and <module/file.h>. You may also be able to use the following syntax in some case if it's convenient:

@import MWPhotoBrowser;
0
ganjaam On

I fixed it by modifying the project settings.

In the target -> build settings of .xcodeproj file of the project, I made the following changes:

  • add $(inherited) in framework search paths
  • add $(inherited) in header search paths
  • add ${PODS_ROOT} and ${PODS_ROOT}/BuildHeaders in user header search paths

In the build settings of Pods.xcodeproj I had to set "Build Active Architecture Only" to "No".