【发布时间】:2015-10-20 22:56:06
【问题描述】:
我正在开发一个快速的 iOS 应用程序,在这个“最后”阶段,我将添加 Google Analytics。
我正在关注他们的Guide
但它在pod install 命令失败...
错误日志
Downloading dependencies
Using Alamofire (1.2.2)
Using Bolts (1.2.0)
Using CryptoSwift (0.0.10)
Using FBSDKCoreKit (4.2.0)
Using FBSDKLoginKit (4.2.0)
Using FBSDKShareKit (4.2.0)
Installing Google (1.0.7)
Installing GoogleAnalytics (3.13.0)
Using GoogleMaps (1.10.1)
Installing GoogleNetworkingUtilities (1.0.0)
Installing GoogleSymbolUtilities (1.0.0)
Installing GoogleUtilities (1.0.1)
Using ImageLoader (0.3.2)
Using SQLite.swift (0.1.0.pre)
Using SwiftyJSON (2.2.0)
[!] The 'Pods-<My-Project>' target has transitive dependencies that include static binaries: (<path-to-project-dir>/Pods/Google/Libraries/libGGLAnalytics.a, <path-to-project-dir>/iOS/Pods/Google/Libraries/libGGLCore.a, <path-to-project-dir>/iOS/Pods/GoogleAnalytics/Libraries/libGoogleAnalytics.a, (...)
正如this tutorial 中所述,“用 Swift 编写的 Pod 必须创建为动态框架”(这就是 Podfile 中 use_frameworks! 的原因)。
看起来,这个新的 Google Analytics pod 是一个静态二进制文件。
我尝试像this answer 一样更改吊舱,但pod install 命令警告我(显然)[!] GoogleAnalytics-iOS-SDK has been deprecated in favor of GoogleAnalytics。而且我不确定将已弃用的库添加到新项目而不是让正确的库正常工作是个好主意。
我的项目对 iOS 8.0+ 有一个目标依赖,并且 podfile 是:
```
来源'https://github.com/CocoaPods/Specs.git'
平台:ios,'8.0'
使用_frameworks!
目标“我的项目”做
pod 'Alamofire', '~> 1.2'
pod 'SwiftyJSON', '~> 2.2.0'
pod 'GoogleMaps'
吊舱'ImageLoader','〜> 0.3.0'
pod 'SQLite.swift', git: 'https://github.com/stephencelis/SQLite.swift.git'
吊舱“FBSDKCoreKit”
pod 'FBSDKLoginKit'
吊舱“FBSDKShareKit”
pod 'CryptoSwift'
pod 'GoogleAnalytics', '~> 3.13'
结束
目标“MyProjectTests”做
结束 ```
是否有人遇到同样的问题或知道如何使用 v3 GA pod 解决此问题?
【问题讨论】:
标签: ios swift google-analytics cocoapods google-analytics-sdk