After updating my google play services to rev 28 i\'m getting this error. Im not sure why this is happening as it was working fine before.
here is my build.gradl
If you are only using play-services-analytics: delete this
compile 'com.google.android.gms:play-services:8.3.0'
The entire library is heavy. And now you can take the part that you need. Analitycs, gcm etc. So you're actually taking twice Analytics
try this
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0-alpha3'
classpath 'com.google.gms:google-services:2.0.0-alpha3'
}
Use these dependencies for the project build.gradle
dependencies {
classpath 'com.android.tools.build:gradle:2.3.1'
classpath 'com.google.gms:google-services:3.0.0'
}
and put this at the end of the app-level build.gradle file (after the dependencies). For some reason I don't understand if you put it at the beginning it will cause problems, make sure you place it at the end.
apply plugin: 'com.google.gms.google-services'
Current version is 2.0.0-beta6...move
apply plugin: 'com.google.gms.google-services'
from the top to the bottom after dependencies as suggested though, I added it to the bottom not realizing it was already at the top. Having it twice by accident annoyed me.
You have to Import the google-services.json physically where your project resides eg:C:\Users\User\Desktop\yourproject\
put your google-services.json here in app folder of yourprojects C:\Users\User\Desktop\yourproject\app <----------in this
you need to add this
dependencies {
compile 'com.google.android.gms:play-services:9.6.1'
}
and remove this
apply plugin: 'com.google.gms.google-services'