Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pod CoreData+MagicalRecord.h file not found

Tags:

I recently had to delete a xcode project from my computer and re-clone it down. After cloning it, I ran a pod install and then went to build the project. However, I kept hitting a error in my .pch file that claimed a file (a pod file) was not found.

I looked into the following SO posts:

iOS - Build fails with CocoaPods cannot find header files

Unit Test build failing when importing MagicalRecord

From there I gathered that I needed to add to Header Search Paths the $(inherited) flag. I've done that, I've cleaned the project, and then re-built it, and still am having the following error..

PCH File

like image 839
Brian Weinreich Avatar asked Oct 14 '14 18:10

Brian Weinreich


2 Answers

As of version 2.3.0 (released on 1 June 2015) the file CoreData+MagicalRecord.h seems to have been renamed to MagicalRecord.h only.

If you installed MagicalRecord using CocoaPods and ran pod install or pod update again you might have gotten this new version and will end up with the same error message: CoreData+MagicalRecord.h file not found

So you should change the import of the header in your pch file then. This is what I have now:

MagicalRecord header file change in pch file

like image 142
Jens Avatar answered Sep 28 '22 09:09

Jens


Try to add this line on top of your podfile:

link_with  ['ProjectName', 'ProjectNameTests'] 

before this line

platform :ios, '8.0' 

Install pod, and at your project Build Setting->Other Linker Flags, add $(inherited).

like image 21
euthimis87 Avatar answered Sep 28 '22 07:09

euthimis87