Pregunta

Recently I've released my networking wrapper with CocoaPods. Since then I have already released few versions and all of them where released without a problem. Now when I try to validate .podspecs file it always fails with following errors:

-> JBMessage (1.0.6)
    - ERROR | [xcodebuild]  JBMessage/JBMessage/JBMessage/JBMessage.m:237:39: error: incompatible block pointer types sending 'void (^)(NSUInteger, NSInteger, NSInteger)' to parameter of type 'void (^)(NSUInteger, long long, long long)'
    - NOTE  | [xcodebuild]  AFNetworking/AFNetworking/AFURLConnectionOperation.h:262:133: note: passing argument to parameter 'block' here
    - ERROR | [xcodebuild]  JBMessage/JBMessage/JBMessage/JBMessage.m:244:41: error: incompatible block pointer types sending 'void (^)(NSUInteger, NSInteger, NSInteger)' to parameter of type 'void (^)(NSUInteger, long long, long long)'
    - NOTE  | [xcodebuild]  AFNetworking/AFNetworking/AFURLConnectionOperation.h:269:128: note: passing argument to parameter 'block' here

Problem was related to setting incompatible block type to AFURLConnectionOperation. I have changed problematic code and latest version 1.0.6 builds without errors / warnings but pod spec lint still complains. Did anybody have some similar problems?

This is my .podspec:

Pod::Spec.new do |s|
    s.name              = "JBMessage"
    s.version           = "1.0.6"
    s.summary           = "JBMessage is simple iOS networking wrapper based on AFNetworking"
    s.homepage          = "https://github.com/josipbernat/JBMessage"
    s.license           = { :type => 'MIT', :file => 'LICENSE' }
    s.author            = { "Josip Bernat" => "josip.bernat@gmail.com" }
    s.social_media_url  = "https://twitter.com/josipbernat"
    s.platform          = :ios, "6.0"
    s.source            = { :git => "https://github.com/josipbernat/JBMessage.git", :commit => "41efff908c7f77e3b7b6097c4197558cfb41eb67", :tag => "1.0.6" }
    s.source_files      = 'JBMessage/JBMessage/*.{h,m}'
    s.requires_arc      = true
    s.dependency        "AFNetworking", "~> 2.2.1"
end
¿Fue útil?

Solución

This line is the culprit:

s.source = { :git => "https://github.com/josipbernat/JBMessage.git", :commit => "41efff908c7f77e3b7b6097c4197558cfb41eb67", :tag => "1.0.6" }

You refer to the 1.0.6 tag. When I go to your repository, that release/tag does not include the latest commit (41efff908c7f77e3b7b6097c4197558cfb41eb67) that solves your incompatible blocks problem. You do define the source to be that commit as well as the tag, but I suspect also specifying the tag overwrites the commit.

You have two options:

  1. Create a new tag, remove the commit specification from your podspec, and update the tag specification to your newly created tag
  2. Remove the tag specification from the podspec and just use the commit

I would go for number 1, because then a CocoaPods release equals a repository release, but that's up to you.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top