Cocoapods: pod spec lint fails - ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code

Created on 8 Jul 2016  Â·  15Comments  Â·  Source: CocoaPods/CocoaPods

Report

Validation fails for podspec.

What did you do?

pod spec lint --use-libraries --allow-warnings --verbose

I tried clearing the pods cache, but that didn't help.

What did you expect to happen?

Podspec validation to be successful.

What happened instead?

 - WARN  | source: Git sources should specify a tag.
    - ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code.
    - WARN  | [Datasnap/Gimbal] xcodebuild:  Datasnap/Datasnap/Classes/Event Properties/User.h:16:23: warning: property type 'Identifier *' is incompatible with type 'NSString *' inherited from 'EventProperty' [-Wincompatible-property-type]
    - NOTE  | [Datasnap/Gimbal] xcodebuild:  Datasnap/Datasnap/Classes/Event Properties/EventProperty.h:12:21: note: property declared here
    - WARN  | [Datasnap/Gimbal] xcodebuild:  Datasnap/Datasnap/Classes/Utilities/BaseClient.m:20:1: warning: control reaches end of non-void function [-Wreturn-type]
    - WARN  | [Datasnap/Gimbal] xcodebuild:  Datasnap/Datasnap/Classes/Utilities/Datasnap.m:73:64: warning: incompatible pointer types sending 'NSNull * _Nonnull' to parameter of type 'NSString *' [-Wincompatible-pointer-types]
    - NOTE  | [Datasnap/Gimbal] xcodebuild:  Datasnap/Datasnap/Classes/Event Properties/Identifier.h:31:48: note: passing argument to parameter 'datasnapUuid' here
    - WARN  | [Datasnap/Gimbal] xcodebuild:  Datasnap/Datasnap/Classes/Utilities/Datasnap.m:184:25: warning: incompatible pointer types initializing 'NSMutableArray *' with an expression of type 'NSArray *' [-Wincompatible-pointer-types]
    - WARN  | [Datasnap/Gimbal] xcodebuild:  Datasnap/Datasnap/Classes/Event Properties/User.h:16:23: warning: auto property synthesis will not synthesize property 'identifier'; it will be implemented by its superclass, use @dynamic to acknowledge intention [-Wobjc-property-synthesis]
    - NOTE  | [Datasnap/Gimbal] xcodebuild:  Datasnap/Datasnap/Classes/Event Properties/User.m:11:17: note: detected while default synthesizing properties in class implementation
    - WARN  | [Datasnap/Gimbal] xcodebuild:  Datasnap/Datasnap/Classes/Utilities/Datasnap.m:187:89: warning: values of type 'NSUInteger' should not be used as format arguments; add an explicit cast to 'unsigned long' instead [-Wformat]
    - WARN  | [Datasnap/Gimbal] xcodebuild:  Datasnap/Datasnap/Classes/Utilities/DatasnapAPI.m:65:127: warning: values of type 'NSInteger' should not be used as format arguments; add an explicit cast to 'long' instead [-Wformat]
    - WARN  | [Datasnap/Gimbal] xcodebuild:  Datasnap/Datasnap/Classes/Utilities/DatasnapAPI.m:71:117: warning: values of type 'NSInteger' should not be used as format arguments; add an explicit cast to 'long' instead [-Wformat]
    - WARN  | [Datasnap/Gimbal] xcodebuild:  Datasnap/Datasnap/Classes/Utilities/GZip.m:101:46: warning: format specifies type 'int' but the argument has type 'unsigned long' [-Wformat]
    - WARN  | [Datasnap/Gimbal] xcodebuild:  Datasnap/Datasnap/Classes/Utilities/NSString+Helpers.m:19:25: warning: implicit conversion loses integer precision: 'NSUInteger' (aka 'unsigned long') to 'CC_LONG' (aka 'unsigned int') [-Wshorten-64-to-32]
    - NOTE  | [iOS] xcodebuild:  clang: error: linker command failed with exit code 1 (use -v to see invocation)
    - WARN  | [Datasnap/Gimbal] xcodebuild:  Datasnap/Datasnap/Classes/Gimbal/GimbalClient.m:41:15: warning: incompatible pointer types assigning to 'User *' from 'NSString *' [-Wincompatible-pointer-types]
    - WARN  | [Datasnap/Gimbal] xcodebuild:  Datasnap/Datasnap/Classes/Gimbal/GimbalClient.m:42:17: warning: incompatible pointer types assigning to 'Device *' from 'NSString *' [-Wincompatible-pointer-types]
    - WARN  | [Datasnap/Gimbal] xcodebuild:  Datasnap/Datasnap/Classes/Gimbal/GimbalClient.m:58:21: warning: unused variable 'baseClient' [-Wunused-variable]
    - WARN  | [iOS] [Datasnap/Gimbal] xcodebuild:  Datasnap/Datasnap/Classes/Gimbal/GimbalClient.m:71:91: warning: values of type 'NSInteger' should not be used as format arguments; add an explicit cast to 'long' instead [-Wformat]
    - WARN  | [iOS] [Datasnap/Gimbal] xcodebuild:  Datasnap/Datasnap/Classes/Gimbal/GimbalClient.m:74:91: warning: values of type 'NSInteger' should not be used as format arguments; add an explicit cast to 'long' instead [-Wformat]

Analyzed 1 podspec.

[!] The spec did not pass validation, due to 1 error.

/Users/laynemcintyre/.rvm/gems/ruby-2.2.1@global/gems/cocoapods-1.0.1/lib/cocoapods/command/spec/lint.rb:77:in `run'
/Users/laynemcintyre/.rvm/gems/ruby-2.2.1@global/gems/claide-1.0.0/lib/claide/command.rb:334:in `run'
/Users/laynemcintyre/.rvm/gems/ruby-2.2.1@global/gems/cocoapods-1.0.1/lib/cocoapods/command.rb:50:in `run'
/Users/laynemcintyre/.rvm/gems/ruby-2.2.1@global/gems/cocoapods-1.0.1/bin/pod:55:in `<top (required)>'
/Users/laynemcintyre/.rvm/gems/ruby-2.2.1/bin/pod:23:in `load'
/Users/laynemcintyre/.rvm/gems/ruby-2.2.1/bin/pod:23:in `<main>'
/Users/laynemcintyre/.rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `eval'
/Users/laynemcintyre/.rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `<main>'

CocoaPods Environment

Stack

   CocoaPods : 1.0.1
        Ruby : ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-darwin14]
    RubyGems : 2.4.8
        Host : Mac OS X 10.11.5 (15F34)
       Xcode : 7.3.1 (7D1014)
         Git : git version 2.6.4
Ruby lib dir : /Users/laynemcintyre/.rvm/rubies/ruby-2.2.1/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ c330f68dce23a9f2f210c481918674b186ea8d41

Installation Source

Executable Path: /Users/laynemcintyre/.rvm/gems/ruby-2.2.1/bin/pod

Plugins

cocoapods-deintegrate : 1.0.0
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.0.0
cocoapods-trunk       : 1.0.0
cocoapods-try         : 1.0.0

Project that demonstrates the issue

https://github.com/datasnap-io/datasnap-ios-sdk/tree/development

Podspec

Pod::Spec.new do |s|
s.name             = 'Datasnap'
s.version          = '2.0.0'
s.summary          = 'The new Datasnap iOS SDK.'

s.description      = <<-DESC
Insight from proximity-triggered engagement through meticulous measurement; predictive analytics; and rich, responsive visualization.
DESC

s.homepage         = 'https://github.com/datasnap-io/datasnap-ios-sdk'
s.license          = { :type => 'APACHE, version 2.0', :file => 'LICENSE' }
s.author           = { 'Layne McIntyre' => '[email protected]' }
s.source           = { :git => 'https://github.com/datasnap-io/datasnap-ios-sdk.git', :commit => '9def49a' }

s.ios.deployment_target = '8.0'

s.source_files = 'Datasnap/Classes/{Event Properties,Event Types,Model,Utilities}/*.{c,h,hh,m,mm}'
s.frameworks = 'CoreData'
s.resources      = 'Datasnap/Classes/**/*.{xcdatamodeld,xcdatamodel}'
s.dependency 'AFNetworking'
s.default_subspec = 'Generic'
s.subspec 'Generic' do |generic|

end
s.subspec 'Gimbal' do |gimbal|
gimbal.dependency 'Gimbal'
gimbal.source_files = 'Datasnap/Classes/{Gimbal,Event Properties,Event Types,Model,Utilities}/*.{h,m}'
end
end

All 15 comments

Ld /Users/segiddins/Library/Developer/Xcode/DerivedData/App-cttlmnkejqdedcdwyamrvfactwmw/Build/Intermediates/App.build/Release-iphonesimulator/App.build/Objects-normal/x86_64/App normal x86_64
    cd /var/folders/p3/950_j_ps7xq47vrzdj1qvg940000gn/T/CocoaPods/Lint
    export IPHONEOS_DEPLOYMENT_TARGET=8.0
    export PATH="/Applications/Xcode-8.0-beta.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode-8.0-beta.1.app/Contents/Developer/usr/bin:/Applications/Xcode-8.0-beta.1.app/Contents/Developer/usr/bin:/Users/segiddins/.gem/ruby/2.3.1/bin:/Users/segiddins/.rubies/2.3.1/lib/ruby/gems/2.3.0/bin:/Users/segiddins/.rubies/2.3.1/bin:/usr/local/heroku/bin:/Users/segiddins/bin:/Applications/Postgres.app/Contents/Versions/9.4/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/Library/TeX/texbin:/sbin:/usr/local/lib/python2.7/site-packages:/opt/X11/bin:/Library/Frameworks/Python.framework/Versions/3.3/bin:/opt/local/bin:/Users/segiddins/.npm:/usr/local/go/bin:/usr/local/share/npm/bin"
    /Applications/Xcode-8.0-beta.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode-8.0-beta.1.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.0.sdk -L/Users/segiddins/Library/Developer/Xcode/DerivedData/App-cttlmnkejqdedcdwyamrvfactwmw/Build/Products/Release-iphonesimulator -L/Users/segiddins/Library/Developer/Xcode/DerivedData/App-cttlmnkejqdedcdwyamrvfactwmw/Build/Products/Release-iphonesimulator/AFNetworking -L/Users/segiddins/Library/Developer/Xcode/DerivedData/App-cttlmnkejqdedcdwyamrvfactwmw/Build/Products/Release-iphonesimulator/Datasnap -F/Users/segiddins/Library/Developer/Xcode/DerivedData/App-cttlmnkejqdedcdwyamrvfactwmw/Build/Products/Release-iphonesimulator -filelist /Users/segiddins/Library/Developer/Xcode/DerivedData/App-cttlmnkejqdedcdwyamrvfactwmw/Build/Intermediates/App.build/Release-iphonesimulator/App.build/Objects-normal/x86_64/App.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -mios-simulator-version-min=8.0 -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -ObjC -lAFNetworking -lDatasnap -framework CoreData -framework CoreGraphics -framework MobileCoreServices -framework Security -framework SystemConfiguration -framework Foundation -lPods-App -Xlinker -dependency_info -Xlinker /Users/segiddins/Library/Developer/Xcode/DerivedData/App-cttlmnkejqdedcdwyamrvfactwmw/Build/Intermediates/App.build/Release-iphonesimulator/App.build/Objects-normal/x86_64/App_dependency_info.dat -o /Users/segiddins/Library/Developer/Xcode/DerivedData/App-cttlmnkejqdedcdwyamrvfactwmw/Build/Intermediates/App.build/Release-iphonesimulator/App.build/Objects-normal/x86_64/App
Undefined symbols for architecture x86_64:
  "_deflate", referenced from:
      +[GZip gzipData:] in libDatasnap.a(GZip.o)
  "_deflateEnd", referenced from:
      +[GZip gzipData:] in libDatasnap.a(GZip.o)
  "_deflateInit2_", referenced from:
      +[GZip gzipData:] in libDatasnap.a(GZip.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

** BUILD FAILED **


The following build commands failed:
    Ld /Users/segiddins/Library/Developer/Xcode/DerivedData/App-cttlmnkejqdedcdwyamrvfactwmw/Build/Intermediates/App.build/Release-iphonesimulator/App.build/Objects-normal/i386/App normal i386
    Ld /Users/segiddins/Library/Developer/Xcode/DerivedData/App-cttlmnkejqdedcdwyamrvfactwmw/Build/Intermediates/App.build/Release-iphonesimulator/App.build/Objects-normal/x86_64/App normal x86_64
(2 failures)

Ok, I added
s.xcconfig = { "OTHER_LDFLAGS" => "-lz" }
to my podspec. Now I'm getting the error below for a few different files. For Gzip.h, the import "zlib.h" is causing problems:
- ERROR | xcodebuild: /Users/laynemcintyre/Library/Developer/Xcode/DerivedData/App-fvodjntowxesosafweftqhonihfc/Build/Products/Release-iphonesimulator/Datasnap/Datasnap.framework/Headers/Gzip.h:9:9: error: include of non-modular header inside framework module 'Datasnap.Gzip' [-Werror,-Wnon-modular-include-in-framework-module]
Do I need to create a module map?

Hm, curious, are you getting this even with --use-libraries? In that case a module map for zlib shouldn't be necessary. You can take a look at https://github.com/stephencelis/SQLite.swift, though, for a Pod which also needs to ship a module map, just for SQLite.

Ah! That was it. I hadn't put --use-libraries. Now it's passing. Thanks!

Cool, keep in mind that passing lint only with --use-libraries means people using use_frameworks! won't be able to successfully use your Pod, and that includes everyone using Swift — so you should consider going down the module map route for zlib.

Hmm. I'm also using the Gimbal pod (a static library) as a main feature of my pod. I have it set as a dependency in my podspec. I get the error
- ERROR | [iOS] [Datasnap/Gimbal] unknown: Encountered an unknown error (The 'Pods-App' target has transitive dependencies that include static binaries: (/private/var/folders/0f/zp_87hmj29g2q6z6blr1zm0r0000gn/T/CocoaPods/Lint/Pods/Gimbal/Frameworks/Gimbal.framework)) during validation.
if I don't put --use-libraries while linting.

Hello,
Anyone please help, i'm also facing issue

Ld /Users/devashish/Library/Developer/Xcode/DerivedData/App-afcnmhoejbqfkpdxwxgzsjfolrgm/Build/Intermediates/Pods.build/Release-iphonesimulator/Applozic.build/Objects-normal/x86_64/Applozic normal x86_64
    cd /var/folders/b3/x476fdzn72v2xxtf5534c3fc0000gn/T/CocoaPods/Lint/Pods
    export IPHONEOS_DEPLOYMENT_TARGET=8.0
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Frameworks/Mono.framework/Versions/Current/Commands"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.3.sdk -L/Users/devashish/Library/Developer/Xcode/DerivedData/App-afcnmhoejbqfkpdxwxgzsjfolrgm/Build/Products/Release-iphonesimulator/Applozic -F/Users/devashish/Library/Developer/Xcode/DerivedData/App-afcnmhoejbqfkpdxwxgzsjfolrgm/Build/Products/Release-iphonesimulator/Applozic -filelist /Users/devashish/Library/Developer/Xcode/DerivedData/App-afcnmhoejbqfkpdxwxgzsjfolrgm/Build/Intermediates/Pods.build/Release-iphonesimulator/Applozic.build/Objects-normal/x86_64/Applozic.LinkFileList -install_name @rpath/Applozic.framework/Applozic -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -mios-simulator-version-min=8.0 -Xlinker -objc_abi_version -Xlinker 2 -framework AVFoundation -framework AddressBook -framework AddressBookUI -framework CoreLocation -framework CoreServices -framework Foundation -framework MediaPlayer -framework SystemConfiguration -framework UIKit -fobjc-arc -fobjc-link-runtime -framework AddressBook -framework AddressBookUI -framework AVFoundation -framework CoreLocation -framework CoreServices -framework Foundation -framework MediaPlayer -framework SystemConfiguration -framework UIKit -single_module -compatibility_version 1 -current_version 1 -Xlinker -dependency_info -Xlinker /Users/devashish/Library/Developer/Xcode/DerivedData/App-afcnmhoejbqfkpdxwxgzsjfolrgm/Build/Intermediates/Pods.build/Release-iphonesimulator/Applozic.build/Objects-normal/x86_64/Applozic_dependency_info.dat -o /Users/devashish/Library/Developer/Xcode/DerivedData/App-afcnmhoejbqfkpdxwxgzsjfolrgm/Build/Intermediates/Pods.build/Release-iphonesimulator/Applozic.build/Objects-normal/x86_64/Applozic
ld: framework not found CoreServices
clang: error: linker command failed with exit code 1 (use -v to see invocation)

** BUILD FAILED **


The following build commands failed:
    Ld /Users/devashish/Library/Developer/Xcode/DerivedData/App-afcnmhoejbqfkpdxwxgzsjfolrgm/Build/Intermediates/Pods.build/Release-iphonesimulator/Applozic.build/Objects-normal/i386/Applozic normal i386
    Ld /Users/devashish/Library/Developer/Xcode/DerivedData/App-afcnmhoejbqfkpdxwxgzsjfolrgm/Build/Intermediates/Pods.build/Release-iphonesimulator/Applozic.build/Objects-normal/x86_64/Applozic normal x86_64
(2 failures)

xcodebuild: Returned an unsuccessful exit code.I'm try other method, but not sucess.Can you help me?

@RiberWang : have you mentioned correct syntax for source and resources in podspec for each type of file?

Example :
screen shot 2017-04-19 at 2 36 02 pm

s.source_files = "RBActionSheet", "RBActionSheetView/*.{h,m}"

I do this, I'm not write of bottom two line .

@Abhishek9634 Thank you!I resove this problem that reason is the path problem.
wrong:
s.source_files = "RBActionSheet", "RBActionSheetView/.{h,m}"
right: s.source_files = "RBActionSheet", "RBActionSheet/
/.{h,m}"
I'm sorry i will not screenshots.

@RiberWang : Awesome!!! :)

@Abhishek9634 I'm was followed you! I believe that we can become friends.Study for you!

@neonichu Using '--use-libraries' can success,but when my podfile in other project contains
'use_frameworks!' this pod will failured. how to solve it?

Ah! That was it. I hadn't put --use-libraries. Now it's passing. Thanks!

@almcintyre Could you please tell me where to use '--use-libraries' ?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

intelliot picture intelliot  Â·  3Comments

marzapower picture marzapower  Â·  3Comments

spencerkohan picture spencerkohan  Â·  3Comments

pronebird picture pronebird  Â·  3Comments

steffendsommer picture steffendsommer  Â·  3Comments