我试图将现有项目转换为cocoapod,以便在我运行时更容易使用
pod spec lint --verbose
我收到了类似
的错误 - ERROR | [iOS] xcodebuild: CoreDataServices/CoreDataServices/Services/Count/CDSCountService.m:28:9: error: use of undeclared identifier 'NSFetchRequest'
我有以下作为我的podspec:
Pod::Spec.new do |s|
s.name = "CoreDataServices"
s.version = "0.2.0"
s.summary = "CoreDataServices contains a set of helper classes to abstract away common core data functionality."
s.homepage = "http://www.williamboles.me"
s.license = { :type => 'MIT',
:file => 'LICENSE.md' }
s.author = "William Boles"
s.platform = :ios, "8.0"
s.source = { :git => "https://github.com/wibosco/CoreDataServices.git",
:branch => "master",
:tag => s.version }
s.source_files = "CoreDataServices/**/*.{h,m}"
s.public_header_files = "CoreDataServices/**/*.{h}"
s.frameworks = 'UIKit', 'CoreData'
s.requires_arc = true
end
我安装了cocoapod版本0.39.0。
使用cocoapods之外的xcodebuild
构建项目会导致项目构建没有错误。
答案 0 :(得分:1)
我最终设法到达那里,但这是一个奇怪的:
Pod::Spec.new do |s|
s.name = "CoreDataServices"
s.version = "0.2.0"
s.summary = "CoreDataServices contains a set of helper classes to abstract away common core data functionality."
s.homepage = "http://www.williamboles.me"
s.license = { :type => 'MIT',
:file => 'LICENSE.md' }
s.author = "William Boles"
s.platform = :ios, "8.0"
s.source = { :git => "https://github.com/wibosco/CoreDataServices.git",
:branch => "master",
:tag => s.version }
s.source_files = "CoreDataServices/**/*.{h,m}"
s.public_header_files = "CoreDataServices/**/*.{h}"
s.requires_arc = true
s.frameworks = 'UIKit', 'CoreData'
end
我将s.requires_arc = true
移到s.framework = 'UIKit', 'CoreData'
之上,错误消失了。
我还注意到,如果我颠倒了框架的顺序,那么它就变成了
s.frameworks = 'CoreData', 'UIKit'
s.requires_arc = true
也有效