【发布时间】:2019-04-25 05:26:17
【问题描述】:
我有一个 Objective-C iOS 库,它使用并发布了第三方静态 C 库。我的一个 Objective-C 源文件使用
导入该库#import <teamspeak/public_errors.h>
但 Cocoapods 生成的 xcode 目标找不到该标头。
这是我的文件夹的简化结构
这是我的.podspec 文件
Pod::Spec.new do |spec|
spec.name = 'TSKit'
spec.version = '0.1.0'
spec.summary = 'An iOS TeamSpeak client'
spec.description = <<-DESC
TSKit is a Objective-C wrapper around the C TeamSpeak client library.
DESC
spec.homepage = 'https://github.com/JanC/TSKit'
spec.license = { :type => 'MIT', :file => 'LICENSE' }
spec.author = { 'Jan Chaloupecky' => 'jan.chaloupecky@gmail.com' }
spec.source = { :git => 'https://github.com/JanC/TSKit.git', :tag => spec.version.to_s }
spec.ios.deployment_target = '8.0'
spec.frameworks = 'AVFoundation', 'AudioToolbox'
spec.source_files = 'TSKit/Classes/**/*'
spec.ios.vendored_library = 'TSKit/lib/libts3client.a'
spec.libraries = "ts3client", 'c++'
spec.preserve_paths = 'TSKit/include/**'
# spec.header_dir = "TSKit/include"
# spec.header_mappings_dir = 'TSKit/include'
spec.pod_target_xcconfig = {"HEADER_SEARCH_PATHS" => "$(PODS_ROOT)/#{spec.name}/include/**"}
end
如您所见,我尝试同时使用 spec.header_dir 和 spec.header_mappings_dir 都没有运气。
pod lib lint 失败:
-> TSKit (0.1.0)
- ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code. You can use `--verbose` for more information.
- NOTE | xcodebuild: note: Using new build system
- NOTE | [iOS] xcodebuild: note: Planning build
- NOTE | [iOS] xcodebuild: note: Constructing build description
- NOTE | [iOS] xcodebuild: warning: Skipping code signing because the target does not have an Info.plist file. (in target 'App')
- NOTE | [iOS] xcodebuild: 10:9: fatal error: 'teamspeak/public_errors.h' file not found
你可以在这里找到一个示例项目(一定要检查so-question 分支)
【问题讨论】:
标签: cocoapods static-libraries podspec