pod lib lint失败隐含的函数声明'DLog'在C99中无效

时间:2016-02-27 23:17:41

标签: ios objective-c xcode cocoapods xcodebuild

我试图在我的prefix.pch文件上声明这个宏,该文件在XCode上运行良好,并在travis上传递验证。

我的宏看起来像:

#ifndef RELEASE

#define DLog(__FORMAT__, ...) NSLog((@"%s [Line %d] " __FORMAT__), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)

#else

#define DLog(...)

#endif

PodSpec提交此文件:

  

Pod :: Spec.new do | s |

     

s.name =“MyExampleProject”   s.version =“1.0.1”   s.summary =“XXX”

     

s.homepage =“XXXXXX”

     

s.license = {:type => 'MIT',:file => 'LICENSE.md'}

     

s.author = {“XX”=> “XX@XX.com”}

     

s.platform =:ios,“8.0”

     

s.source = {:git => “https://github.com/XX/XX.git”,:branch => “master”,:tag => s.version}

     

s.source_files =“MyExampleProject / / 。{h,m}”   s.public_header_files =“MyExampleProject / / 。{h}”

     

s.requires_arc = true   端

运行pod lib lint MyExampleProject.podspec时,我得到:

MyExampleProject (1.0.1)

- ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code. You can use - {冗长{1}}

for more information.

1 个答案:

答案 0 :(得分:0)

我终于找到了答案: apptentive-ios

我需要手动添加- WARN | [iOS] xcodebuild: ../MyExampleClass.m:87:9: warning: implicit declaration of function 'DLog' is invalid in C99 [-Wimplicit-function-declaration]的内容,因为xcodebuild没有从中读取它。就我而言,我将prefix.pch的内容移到了伞形标题中。

这就是我的prefix.pch现在的样子:

  

Pod :: Spec.new do | s |

     

s.name =“MyExampleProject”   s.version =“1.0.1”   s.summary =“XXX”

     

s.homepage =“XXXXXX”

     

s.license = {:type => 'MIT',:file => 'LICENSE.md'}

     

s.author = {“XX”=> “XX@XX.com”}

     

s.platform =:ios,“8.0”

     

s.source = {:git => “https://github.com/XX/XX.git”,:branch => “master”,:tag => s.version}

     

podspec

     

s.source_files =“MyExampleProject / / 。{h,m}”   s.public_header_files =“MyExampleProject / / 。{h}”

     

s.requires_arc = true   端

完整项目可以在这里看到:EasyDoanloadSession