我正在尝试为WLXBluetoothDevice项目制作新的Podspec。我被困在pod spec lint。我在podspec文件中声明了它的一个依赖项:
s.dependency 'CocoaLumberjack'
(......奇怪的是,如果我在该声明中包含当前版本,lint很快就会失败,说它无法满足依赖性。)
当我调用pod spec lint时,会触发xcodebuild,并失败:
** BUILD FAILED **
The following build commands failed:
CompileC /var/folders/yz/xbdghvnj1_7fhsrwl5v232b40000gn/T/CocoaPods/Lint/build/Pods.build/Release-iphonesimulator/WLXBluetoothDevice.build/Objects-normal/i386/WLXBluetoothDeviceLogger.o WLXBluetoothDevice/WLXBluetoothDevice/WLXBluetoothDeviceLogger.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
-> WLXBluetoothDevice (0.6.1)
- ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code.
- NOTE | xcodebuild: WLXBluetoothDevice/WLXBluetoothDevice/WLXBluetoothDeviceLogger.h:12:9: fatal error: 'CocoaLumberjack/CocoaLumberjack.h' file not found
Analyzed 1 podspec.
[!] The spec did not pass validation, due to 1 error.
我已成功安装到另一个使用pod的项目...所以它似乎只是对此不满意的lint构建。有什么建议吗?
答案 0 :(得分:0)
我使用了此答案中描述的格式来解决问题:https://stackoverflow.com/a/23457452/2799670
而不是问题中描述的依赖关系,我声明了依赖关系的子规范,如下所示:
s.subspec "CocoaLumberjack" do |ss|
ss.dependency "CocoaLumberjack", "~> 2.2.0"
ss.xcconfig = { "FRAMEWORK_SEARCH_PATHS" => "$(PODS_ROOT)/CocoaLumberjack"}
end