如何向CocoaPods添加依赖

问题描述 投票:0回答:1

我正在尝试创建一个 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 update 并收到以下错误

[!] 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

ios cocoapods
1个回答
0
投票

使用

pod lib lint BannerViewController.podspec --use-libraries

© www.soinside.com 2019 - 2024. All rights reserved.