首页 文章

Google Analytics v3 Pod与其他Swift Pod

提问于
浏览
4

我正在开发一个快速的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中所述,"pods written in Swift must be created as dynamic frameworks"(这就是为什么Podfile中的 use_frameworks! ) . 看起来,这个新的Google Analytics pod是一个静态二进制文件 .

我试图改变pod与this answer相同,但 pod install 命令警告我(显然) [!] GoogleAnalytics-iOS-SDK has been deprecated in favor of GoogleAnalytics . 而且我认为将已经弃用的库添加到新项目中是一个好主意,而不是让正确的库工作 .

我的项目具有iOS 8.0的目标依赖性,podfile是:

平台:ios,'8.0'
use_frameworks!

目标'MyProject'做

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](https://github.com/stephencelis/SQLite.swift.git)'
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
pod 'FBSDKShareKit'
pod 'CryptoSwift'
pod 'GoogleAnalytics','~> 3.13'
结束

目标'MyProjectTests'做

结束```

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

1 回答

  • 2

    更换线

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

    在你的Podfile中

    pod 'GoogleAnalytics', '~> 3.13'
    

    清理项目并再次运行pod安装 . 您当前使用的pod是不推荐使用的pod .

相关问题