clang错误地为源文件添加前缀

时间:2016-09-23 07:52:59

标签: xcode cocoapods

当我构建我的(Swift)Xcode项目时,我收到以下错误:

clang: error: no such file or directory: '/path/to/DerivedData/MyProject-btmqlitphlzsmgfdbhbzoygglxgm/Build/Intermediates/MyProject.build/Debug-iphonesimulator/MyProject.build/DerivedSources/CoreDataGenerated/MyProject/MyProject.MySourceFile+CoreDataProperties.m'
clang: error: no input files

请注意,它抱怨的文件是MyProject.MySourceFile+CoreDataProperties.m。如果我在派生数据中转到该目录,我会看到实际文件为MySourceFile+CoreDataProperties.m而没有MyProject前缀。

这可能与Cocoapods有关;我的Podfile如下

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'

target 'MyProject' do
    use_frameworks!
    pod 'Alamofire', '~> 4.0'
    pod 'AlamofireImage', '~> 3.0'
    pod 'XCGLogger', :git => 'https://github.com/DaveWoodCom/XCGLogger.git', :branch => 'swift_3.0'
end

我最近将我的项目迁移到了Xcode 8 + Swift 3,并为Swift 3提供了更新的依赖项。

1 个答案:

答案 0 :(得分:0)

最后,我无法准确确定问题所在,但可能与名称空间和核心数据有关。可能是由于我将这个项目迁移到Xcode 8 / Swift 3而引发的。

我所做的是在Xcode中删除所有我的核心数据模型定义(但源文件)。然后我煞费苦心地重新创建它们,现在我的项目正常建立。