我正在尝试为我的项目设置podspec,当我运行pod spec lint
➭ pod spec lint
-> BRECBathroomFinder (1.0.0)
- ERROR | [iOS] Returned an unsuccessful exit code. You can use `--verbose` for more information.
- ERROR | BRECBathroomFinder/BRECBathroomFinder/BBFOpenDataClient.swift:16:26: error: use of undeclared type 'AFHTTPRequestOperationManager'
- ERROR | [iOS] BRECBathroomFinder/BRECBathroomFinder/BBFOpenDataClient.swift:29:73: error: use of undeclared type 'AFHTTPRequestOperation'
- ERROR | [iOS] BRECBathroomFinder/BRECBathroomFinder/BBFOpenDataClient.swift:48:35: error: use of undeclared type 'AFHTTPRequestOperation'
- NOTE | [iOS] }, failure: { (operation: AFHTTPRequestOperation!, error: NSError!) -> Void in
- ERROR | [iOS] BRECBathroomFinder/BRECBathroomFinder/BBFOpenDataClient.swift:29:9: error: 'BBFOpenDataClient' does not have a member named 'GET'
Analyzed 1 podspec.
这是我的podspec。你会在底部注意到我的.prefix_header_contents = "#import <AFNetworking/AFNetworking.h>"
在那里;所以我无法找到AFHTTPRequestOperation类。
Pod::Spec.new do |s|
s.name = "BRECBathroomFinder"
s.version = "1.0.0"
s.summary = "A pod that finds nearby BREC parks with restrooms"
s.description = <<-DESC
This is a project built on top of Baton Rouge's Open Data API. It uses a query to find parks with bathrooms.
The results can be sorted according to how close the parks are to a given location or the user's location.
DESC
s.homepage = "https://github.com/jmhooper/BRECBathroomFinder"
s.author = { "Jonathan Hooper" => "jon9820@gmail.com" }
s.license = 'MIT'
s.source = { git: "https://github.com/jmhooper/BRECBathroomFinder.git", tag: s.version.to_s }
s.platform = :ios, '8.0'
s.requires_arc = true
s.source_files = "BRECBathroomFinder/**/*"
s.dependency "AFNetworking", "~> 2.0"
s.frameworks = "CoreLocation"
s.prefix_header_contents = "#import <AFNetworking/AFNetworking.h>"
end
答案 0 :(得分:4)
在它抱怨的文件中,我不得不添加import AFNetworking
行以及我的其他Swift导入。
我做到了,podspec通过了验证。