Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode "Could Not Build Module MobileCoreServices.h" when importing the framework

I'm trying to use UIImagePickerController, but I need to include the MobileCoreServices framework in order to do so.

I've placed the import statement in my ViewController.h file:

#import <MobileCoreServices/MobileCoreServices.h>

But I get an error:

"Could not build module MobileCoreServices.h".

I've also already linked the MobileCoreServices framework in the project build phrases, and I see it there on the sidebar in the frameworks folder, but it's still giving me an error.

Does anyone know a solution this?

like image 523
hmzfier Avatar asked Jan 10 '23 12:01

hmzfier


1 Answers

Nevermind everyone!

This problem was solved by another SO user on another thread:

Could not build module 'UIKit" in cocoapods since Xcode 5.1

Go to your DerivedData directory and remove ModuleCache directory.

In terminal:

cd ~/Library/Developer/Xcode/DerivedData
rm -rf ModuleCache/

Keeping this thread alive in case anyone else runs into this problem in the future.

Thanks!

like image 79
hmzfier Avatar answered Jan 21 '23 07:01

hmzfier