So, I am getting the following error while running the project after upgrading build.gradle (Project) from
dependencies {
classpath \'com.android.too
If you bring in to the code same library from 2 different sources that will cause the error.
I've noticed this can happen (sometimes) when editing java files while Android Studio is building.
I solved this by manually deleting the build
folder and running agin.
If you are applying any plugins. Then, in your module Gradle file (usually the app/build.gradle
),make sure you add the apply plugin
line at the bottom of the file to enable the Gradle plugin.
e.g.
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile fileTree(include: 'Parse-*.jar', dir: 'libs')
compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.android.support:cardview-v7:23.2.0'
compile 'com.android.support:design:24.0.0-alpha1'
compile "com.google.firebase:firebase-invites:9.2.0"
compile "com.google.firebase:firebase-ads:9.2.0"
compile 'com.google.firebase:firebase-database:9.2.0'
compile 'com.google.firebase:firebase-core:9.2.0'
}
I add the com.google.firebase:firebase-core:9.2.0
line and choose the same version (9.2.0) for all firebase libraries and the issue was solved.
I had the same problem and it is caused by not same version of google analytics and firebase. I used 'com.google.gms:google-services:3.1.0'
and then add these dependencies:
compile 'com.google.android.gms:play-services-gcm:10.2.6'
compile 'com.google.firebase:firebase-crash:10.0.1'
So change firebase version to 10.2.6 fix this problem.
compile 'com.google.android.gms:play-services-gcm:10.2.6'
compile 'com.google.firebase:firebase-crash:10.2.6'
Check you build.gradle (Module: your app).
All com.google.android.gms libraries must use the exact same version specification (mixing versions can lead to runtime crashes).
For example: If you have com.google.firebase:firebase-ads:9.6.1 and com.google.android.gms:play-services-basement:10.0.1
You have to change the firebase version to: 10.0.1