I migrated to Android Studio 3 and Gradle 4. Then I changed compile
to implementation
in my build.gradle files. But I get the error:
this worked for me:
add following code into your your buildscript
subprojects {
project.configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.android.support'
&& !details.requested.name.contains('multidex') ) {
details.useVersion "version which should be used - in your case 11.6.0"
}
}
}
}
Best Regards,
Eddi
Changing the version of google-services over the top level gradle file fixed the issue for me. It seems the older version is indirectly injecting the firebase-core versions and updating the firebase version explicitly makes the conflict
classpath 'com.google.gms:google-services:4.0.2' // Just updated the version here.
It appears that, previously, you were implicitly depending on the common-lib module to export Firebase SDKs to your app module. Now that you've changed from "compile" to "implementation", you're no longer exporting those SDKs. So, what's happening now is this: the google-services plugin is adding v9.0.0 of firebase-core to your app module since it no longer sees it present in the visible classpath of your app module.
You should be able to work around this by manually adding firebase-core to your app module at the correct version. Or, you can continue to export Firebase SDKs from your library module to your app module by switching to an "api" dependency instead of an "implementation" dependency.
I upgraded compileSdkVersion & targetSdkVersion to 28 and I also faced this same error.
I upgraded all the dependencies version in app.gradle to 28.0.0 and also in project .gradle file upgraded com.android.tools.build:gradle to 3.3.2
i.e classpath 'com.android.tools.build:gradle:3.3.2'
After this project synced successfully
subprojects {
project.configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.android.support'
&& !details.requested.name.contains('multidex') ) {
details.useVersion "26.1.0"
}
}
}
}
put this code in your project gradle