11

Where I can find the Google Analytics Android lib groupId and archetype for my projects pom?

I've been searching for it for a couple of hours, and I can't find any clue...(

P.S. I found something on GitHub, but it seam like it uses an third-party repository (when I try to run mnv install or compile it gives me an error):

<dependency>
  <groupId>com.google.android.analytics</groupId>
  <artifactId>analytics</artifactId>
  <version>2</version>
</dependency>
Serj Lotutovici
  • 4,370
  • 5
  • 32
  • 41
  • 3
    Maps, analytics and other Android jars are not fully maintained in any online Maven repository AFAIK, Just download them via Android SDK manager and install to local repository yourself, more in [this similar discussion](http://stackoverflow.com/questions/10385664/cant-find-maven-dependency-for-google-apis-to-use-maps/10392014#10392014). – yorkw Oct 31 '12 at 20:14
  • thenks... but it realy becomes an issue, when you work in a team... I hope that some day google will fix that... – Serj Lotutovici Oct 31 '12 at 21:24
  • You can always create your own maven repos and host them on GitHub or something. – Jon Willis Feb 06 '13 at 15:54

2 Answers2

7

You can install all missing android libs using maven-android-sdk-deployer. It installs all extras in local maven repository from android sdk folder. Usage is quite simply: download and run mvn install. Deployer itself doesn't support optional dependencies other than sdk version. You must install all jars via SDK Manager at first.

Update: Upon writing this answer Google has landed updates to SDK Manager and included 2 maven repositories in it: Google Repository and Android Support Repository. All you have to do is add them to repositories list in pom.xml. It provides following artifacts:

  • support library (v4, v13)
  • gridlayout (v7)
  • google play services (3.1.36)

As you can see it doesn't have analytics artifacts, so you still need maven-android-sdk-deployer

mente
  • 2,746
  • 1
  • 27
  • 33
  • Thx, may be for some one it will come in handy. In our company we decided to use a local maven repository, and keep all unsupported libs there. – Serj Lotutovici Jun 03 '13 at 11:18
  • what should I write in build.gradle instead of: compile files('libs/libGoogleAnalyticsServices.jar') ? Something like: compile 'com.google.analytics:Analytics:3.+' ? – Gavriel Mar 19 '14 at 20:00
  • Analytics wasn't added to maven repo. So you still have to use `compile files('libs/libGoogleAnalyticsServices.jar')` – mente Mar 20 '14 at 08:42
  • @mente What URLs should be used for "Google Repository" and "Android Support Repository" ? – David Andreoletti Mar 27 '14 at 08:17
  • 1
    @DavidAndreoletti these repositories are installed locally with Android SDK. If you're using Gradle build system it's already included and you don't need to do anything – mente Mar 27 '14 at 14:36
2

Starting with Google Analytics SDK v4, Google Analytics is part of Google Play Services. There's no need for a separate dependency anymore.

https://developers.google.com/analytics/devguides/collection/android/changelog

Guno Heitman
  • 899
  • 8
  • 16