Google Analytics v3 Pod with other Swift Pods

I am developing a quick application for iOS, and at this “final” stage I will add Google Analytics.

I follow their guide

But the pod install command failed to execute ...

Error log
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, (...)

As stated in this tutorial , "pods written in Swift must be created as dynamic frames" (and therefore use_frameworks! In the Subfile). This new Google Analytics module seems to be static binary.

I tried to change the pod just like this answer , but the pod install command warned me that (obviously) [!] GoogleAnalytics-iOS-SDK has been deprecated in favor of GoogleAnalytics . And I'm not sure that it’s nice to add an already obsolete library to a new project, instead of working correctly.

My project has a target dependency on iOS 8.0+, and the file is:
`` `source ' https://github.com/CocoaPods/Specs.git '
platform: ios, '8.0'
use_frameworks!

target 'MyProject' do

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

target 'MyProjectTests' do

end ``

Does anyone have the same problem or know how to solve this problem with the v3 GA module?

+4
source share
1 answer

Replace string

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

in your subfile with

 pod 'GoogleAnalytics', '~> 3.13' 

Clean the project and run the installer again. The module you are using is the one that is out of date.

+2
source

All Articles