【问题标题】:Pod CoreData+MagicalRecord.h file not found未找到 Pod CoreData+MagicalRecord.h 文件
【发布时间】:2014-12-09 15:14:16
【问题描述】:

我最近不得不从我的计算机中删除一个 xcode 项目并重新克隆它。克隆后,我运行了pod install,然后开始构建项目。但是,我的 .pch 文件中不断出现错误,声称找不到文件(pod 文件)。

我查看了以下 SO 帖子:

iOS - Build fails with CocoaPods cannot find header files

Unit Test build failing when importing MagicalRecord

从那里我收集到我需要添加到 标题搜索路径 $(inherited) 标志。我已经这样做了,我已经清理了项目,然后重新构建了它,但仍然出现以下错误..

【问题讨论】:

    标签: ios objective-c cocoapods


    【解决方案1】:

    尝试将此行添加到您的 podfile 顶部:

    link_with  ['ProjectName', 'ProjectNameTests']
    

    在这一行之前

    platform :ios, '8.0'
    

    安装 pod,然后在您的项目 Build Setting->Other Linker Flags 添加 $(inherited)。

    【讨论】:

    • 作为对其他任何人的说明,我开始收到 diff: /../Podfile.lock: No such file or directory 用于我的 ProjectNameTests 目录。所以,我不得不进入项目部署目标,点击“信息”,在“配置”下必须设置 ProjectNameTests 以使用 Pods.debug 配置文件
    【解决方案2】:

    尝试在终端运行命令(1),然后在步骤(2)中添加导入

    1. 在你的项目目录中,运行pod update

    2. 您现在应该可以添加

    #import <MagicalRecord/CoreData+MagicalRecord.h>

    到目标的任何源文件并开始使用 MagicalRecord!

    我认为你可以通过 2 个步骤来解决这个问题。

    【讨论】:

      【解决方案3】:

      截至版本 2.3.0(2015 年 6 月 1 日发布)文件 CoreData+MagicalRecord.h 似乎已重命名MagicalRecord.h

      如果您使用 CocoaPods 安装 MagicalRecord 并再次运行 pod installpod update,您可能已经获得了这个新版本,并且最终会收到相同的错误消息:CoreData+MagicalRecord.h file not found

      因此,您应该在 pch 文件中更改标题的 import。这就是我现在拥有的:

      【讨论】:

        【解决方案4】:

        导入“MagicalRecord/MagicalRecord.h”

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 2017-05-23
          • 1970-01-01
          • 2018-10-30
          • 2020-04-13
          • 2012-05-27
          • 2015-10-27
          • 1970-01-01
          相关资源
          最近更新 更多