Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Podspec fails to pass validation, but no ERROR logged

I have some apps that are quite similar. Therefore, I'd like to create a or some private pod(s) containing all common reusable code. My first version contains some networking functionality that uses AFNetworking and also uses KeychainItemWrapper:

Pod::Spec.new do |s|

  s.name          = 'CommonLib'
  s.version       = '0.0.1'
  s.homepage      = '****'
  s.summary       = 'My Common lib'
  s.description   = 'Library with common code'
  s.author        = { "Rens Verhage" => "*****" }
  s.platform      = :ios, '5.0'
  s.source        = { :git => "ssh://****/CommonLib.git", :tag => s.version.to_s }
  s.source_files  = 'CommonLib/*.{h,m}'
  s.requires_arc  = true

  s.dependency 'AFNetworking', '~> 1.3.1'
  s.dependency 'KeychainItemWrapper', '~> 1.2'
end

Running pod spec lint CommonLib.podspec gives a couple of WARN and NOTE messages:

 -> CommonLib (0.0.1)
    - WARN  | Missing required attribute `license`.
    - WARN  | Missing license type.
    - NOTE  | [xcodebuild]  AFNetworking/AFNetworking/AFHTTPClient.h:84:9: warning: SystemConfiguration framework not found in project, or not included in precompiled header. Network reachability functionality will not be available. [-W#pragma-messages]
    - NOTE  | [xcodebuild]  AFNetworking/AFNetworking/AFHTTPClient.h:89:9: warning: MobileCoreServices framework not found in project, or not included in precompiled header. Automatic MIME type detection when uploading files in multipart requests will not be available. [-W#pragma-messages]
    - NOTE  | [xcodebuild]  CommonLib/CommonLib/NSArray+NSArray_PerformSelector.m:19:35: warning: performSelector may cause a leak because its selector is unknown [-Warc-performSelector-leaks]
    - NOTE  | [xcodebuild]  CommonLib/CommonLib/NSArray+NSArray_PerformSelector.m:19:51: note: used here
    - WARN  | [iOS] Unable to find a license file

Analyzed 1 podspec.

[!] The spec did not pass validation.

Notice there are no ERROR messages, but the spec doesn't pass validation however. I don't really no where to go from here. The message that the SystemConfiguration and MobileCoreServices frameworks are missing looks like an error to me. I tried fixing this warning by adding

s.ios.frameworks = 'MobileCoreServices', 'SystemConfiguration'

to my podspec, but that doesn't work.

So, two questions in one:

  1. What is the error that keeps my podspec from passing validation?
  2. How can I fix the warning about missing frameworks?
like image 392
Rens Verhage Avatar asked Sep 13 '13 07:09

Rens Verhage


2 Answers

Recently I had this problem and adding --allow-warnings fixes the issue.

pod spec lint MyProject.podspec --allow-warnings
like image 99
Josip B. Avatar answered Nov 21 '22 00:11

Josip B.


Ok. Got my answer from the Cocoapods guys. Podspec validation fails on all errors and warnings. Failing on warnings doesn't mean the project fails as a Pod. Turns out I can simply ignore the warning.

As for AFNetworking, the issue has been resolved with version 2.0.

like image 8
Rens Verhage Avatar answered Nov 21 '22 00:11

Rens Verhage