4

我正在开发一个快速的 iOS 应用程序,在这个“最后”阶段,我将添加 Google Analytics。

我正在遵循他们的指南

但它在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, (...)

本教程所述,“用 Swift 编写的 Pod 必须创建为动态框架”(这就是use_frameworks!Podfile 中的原因)。看起来,这个新的 Google Analytics pod 是一个静态二进制文件。

我尝试将 pod 更改为与此答案相同,但pod install命令警告我(显然)[!] GoogleAnalytics-iOS-SDK has been deprecated in favor of GoogleAnalytics。而且我不确定将已弃用的库添加到新项目而不是让正确的库工作是一个好主意。

我的项目对 iOS 8.0+ 有一个目标依赖,并且 podfile 是:
``` source ' https://github.com/CocoaPods/Specs.git '
platform :ios, '8.0'
use_frameworks!

目标“我的项目”做

pod 'Alamofire', '~> 1.2'
pod 'SwiftyJSON', '~> 2.2.0'
pod 'GoogleMaps'
pod 'ImageLoader', '~> 0.3.0' pod 'SQLite.swift', git: ' https: //github.com/stephencelis/SQLite.swift.git '
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
pod 'FBSDKShareKit'
pod 'CryptoSwift'
pod 'GoogleAnalytics', '~> 3.13'
end

目标“MyProjectTests”做

结束```

有没有人有同样的问题或知道如何使用 v3 GA pod 解决这个问题?

4

1 回答 1

2

换行

pod 'GoogleAnalytics-iOS-SDK', '~> 3.10'

在你的 Podfile 中

pod 'GoogleAnalytics', '~> 3.13'

清理项目并再次运行 pod install。您当前使用的 pod 已被弃用。

于 2015-09-04T12:31:40.117 回答