Linkandzelda
Linkandzelda

Reputation: 611

How to use libGoogleAnalyticsV2.jar with Android Studio

I'm trying to get the libGoogleAnalyticsV2.jar imported to my project in Android Studio. First I added it using the Project Structure which corrected any red lines when trying to use EasyTracker. But when I compiled it resulted with errors and the build failed.

Gradle: package com.google.analytics.tracking.android does not exist
Gradle: cannot find symbol variable EasyTracker
Gradle: cannot find symbol variable EasyTracker

I'm using the lib like this:

EasyTracker.getInstance().activityStart(this);

What can I do to make this work? Thanks

Upvotes: 4

Views: 6908

Answers (1)

user910046
user910046

Reputation: 368

You need to reference the jar in the build.gradle, something like this:

dependencies {
    ....
    compile files('libs/libGoogleAnalyticsV2.jar')

libs in this case being the libs dir in your project, above src

Upvotes: 14

Related Questions