How to use libGoogleAnalyticsV2.jar with Android Studio

I am trying to get libGoogleAnalyticsV2.jar imported into 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, it led to errors and build failure.

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

I use lib as follows:

 EasyTracker.getInstance().activityStart(this); 

What can I do to make this work? Thanks

+4
source share
1 answer

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

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

libs , in this case it is the libs directory in your project, above src

+15
source

Source: https://habr.com/ru/post/1495358/


All Articles