如何向Cocoapods添加依赖项

时间:2015-08-07 16:05:00

标签: ios cocoapods

我正在尝试创建一个Cocoapods库。我的图书馆将包含Google-Mobile-Ads-SDK作为依赖项。我使用了以下命令

pod lib create BannerViewController
 > my email address
What language do you want to use?? [ ObjC / Swift ]
 > Swift
Would you like to include a demo application with your library? [ Yes / No ]
 > Yes
Which testing frameworks will you use? [ Quick / None ]
 > None
Would you like to do view based testing? [ Yes / No ]
 > No  

然后我编辑了BannerViewController.podspec,添加了以下行

s.dependency 'Google-Mobile-Ads-SDK', '~> 7.0'

我尝试使用pod lib lint BannerViewController.podspec

[!] BannerViewController did not pass validation, due to 1 error and 3 warnings.
You can use the `--no-clean` option to inspect any issue.

我尝试在示例目录中进行pod更新并出现以下错误

[!] The 'Pods-BannerViewController_Example' target has transitive dependencies that include static binaries: (/Developer/BannerViewController/Example/Pods/Google-Mobile-Ads-SDK/GoogleMobileAdsSdkiOS-7.4.0/GoogleMobileAds.framework)

我不知道如何将Google-Mobile-Ads-SDK添加到我的开发窗格中,以便我可以在本地测试我的代码。 Cocoapods文档不清楚。我正在使用Cocoapods 0.38.2

1 个答案:

答案 0 :(得分:0)

使用pod lib lint BannerViewController.podspec --use-libraries