Kodr.F
Kodr.F

Reputation: 14390

google Analytics V4 cannot be imported?

I'am trying to add Google Analytics to my application

I've followed every step at this page

https://developers.google.com/analytics/devguides/collection/android/v4/#tracking-methods

the issue is Eclipse not recognized Tracker and GoogleAnalytics

the Google play service and every thing are installed from SDK

I've tried to search for V4 Analytics SDK i could't find it

i don't know if i mess something here

any advice ?

Upvotes: 3

Views: 2134

Answers (2)

erdomester
erdomester

Reputation: 11829

In Android Studio you need to add the google play services as dependency to gradle. For example:

compile 'com.google.android.gms:play-services:6.5.87'

After that click the Sync Project with Gradle Files icon and it should work.

Upvotes: 0

Kodr.F
Kodr.F

Reputation: 14390

Finally found the solution ..

Google Analytics V4 has no SDK , its depends on Google Play Services SDK

So here is what i did :

  1. download Google Play Services SDK from Android SDK
  2. go to Android SDK folder on you PC partition
  3. Follow this path (/extras/google/google_play_services/libproject/ )
  4. you'll find this folder ( google-play-services_lib ) <- thats what we need
  5. now go to Eclipse and import this Project ( google-play-services_lib ) as Library
  6. right click on your project Properties -> Android -> Second Tab ( Library ) Click Add and select google-play-services_lib

Now you've done you can use Google Analytics V4 with no problems at all

The Idea is you need to download and import Google Play Services to Eclipse then add the library to your project .

enjoy coding ..

Upvotes: 8

Related Questions