EricaCooksey
EricaCooksey

Reputation: 239

Cannot import com.google.android.gms.analytics after upgrading to Google Play Services 7+

My application currently uses Google Play Services version 6.5.87. When I tried to upgrade to the latest version (7+), I get compiler errors trying to import com.google.android.gms.analytics. I cannot find any evidence that this library has been deprecated or does not work with the latest google play. Can anyone shed some light on this?

Upvotes: 0

Views: 420

Answers (1)

Mattia Maestrini
Mattia Maestrini

Reputation: 32780

From version 6.5, you can selectively compile Google Play service APIs into your app.

In version 6.5 analytics is included in play-services-base. From Google Play Services 7.0 analytics has his own description play-services-analytics and it is no more included in the base description.

Add this line to your build.gradle:

dependencies {
    ...
    compile 'com.google.android.gms:play-services-analytics:7.3.0'
}

Upvotes: 1

Related Questions