Using ARAnalytics with GoogleAnalytics
I've added this to my podfile (Cocoapods 0.39.0):
pod 'ARAnalytics', :subspecs => ['GoogleAnalytics']
But I get this error when running pod install:
$ pod install
Updating local specs repositories
Analyzing dependencies
Downloading dependencies
Installing ARAnalytics (3.8.0)
Using Bolts (1.3.0)
Using CardIO (5.1.1)
Using CircleProgressView (1.0.7)
Using Crashlytics (3.3.4)
Using FBSDKCoreKit (4.7.0)
Using FBSDKLoginKit (4.7.0)
Using Fabric (1.5.5)
Installing Google (1.1.1)
Installing GoogleAnalytics (3.13.0)
Installing GoogleInterchangeUtilities (1.0.0)
Installing GoogleNetworkingUtilities (1.0.0)
Installing GoogleSymbolUtilities (1.0.0)
Installing GoogleUtilities (1.1.0)
Using JVFloatLabeledTextField (1.1.0)
Using Lookback (1.1.3)
Using LookbackSafe (1.1.3)
Using MBProgressHUD (0.9.1)
Using PDKTZipArchive (0.3.5)
Using Parse (1.9.0)
Using SDWebImage (3.7.3)
Using SwiftKeychain (0.1.5)
Using TAPageControl (0.2.0)
Using UIImageViewAligned (0.0.1)
[!] The 'Pods-MyProject' target has transitive dependencies that include static binaries: (/myproject/Pods/Google/Libraries/libGGLAnalytics.a and /project/Pods/Google/Libraries/libGGLCore.a)
I saw this has been raised before: https://github.com/orta/ARAnalytics/issues/145
and @orta recommends using Google's static frameworks. So I downloaded it, integrated it manually (eeew), left the Podfile unchanged.
But then running pod install results in exactly the same error.
So I did this: pod 'ARAnalytics', :subspecs => [], and the pod install runs fine.
But now ARAnalytics isn't installed at all!
How does one use ARAnalytics with Google Analytics??
So until Google supports Dynamic Frameworks, you have to do the integration manually; I had to do this for Intercom in one of my apps.
- Copy in the provider into your app.
- If it was the only provider, only link to
CoreIOS( pod "ARAnalytics/CoreIOS" ) - Add the integration manually before you setup all your analytics.
Is there a place we can see if/when Google updates to Dynamic Frameworks?
@orta adding GoogleAnalyticsProvider manually inside the app leading to lots of compilation errors inside the ARAnalyticalProvider.h file inside the pod. Am I missing something?
Here is what I did - (1) I added Google analytics separately via Pod. (2) Then I copied the Google analytics provider inside the app. (3) Added appropriate code in app delegate. (4) On compilation its showing lots of error - eg. "Unknown type String" inside the ARAnalyticalProvider.h
Here is the two lines inside my podfile.
pod 'Google/Analytics' pod "ARAnalytics", :subspecs => ["Flurry"]
Update :-
Quite weird thought but I fixed it by adding
#import <Foundation/Foundation.h>
on top of ARAnalyticalProvider.h
Cool, might be worth sending a PR adding the Foundation import?
@kidsid49 Did you do anything else? (or can you go into more detail on step 3?)
AR_GOOGLEANALYTICS_EXISTS doesn't hold true when I try your approach:

Thanks
whoops. nevermind. Didn't read Orta's step 3 clearly enough Add the integration manually before you setup all your analytics
@orta are there any updates on this? As far as I understand, Google is offering Google Analytics as a dynamic framework, but I am not sure how to fix this.. I have currently copied the provider in my project and set it up manually, but this is not a very clean solution..
Nothing from my side, I don't use Google Analytics etc, you're welcome to fix it upstream 👍
@orta I really tried to fix this and I have a strange issue right now. In an example project I created an podspec and just copied the content of ARAnalytics.podspec to it. (I changed 'GoogleAnalytics' to 'Google/Analytics' since this is the dynamic framework from Google). This works with use_frameworks! Using ARAnalytics with the exact same change does not (transitive dependencies). The resolved local podspecs Cocoapods is building (Pods/Local Podspecs/*) have only one diff: the name of the pods. Do you have any clue why this happens? I can show you the project if you want.
any fixes about it?