Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 254
Linkandzelda Avatar asked Dec 08 '22 13:12

Linkandzelda


1 Answers

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

like image 180
user910046 Avatar answered Dec 26 '22 17:12

user910046