Only solution that work for me (found some where in SOF)(don't have the link) is :
in top main build.grale
allprojects {
subprojects {
project.configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.google.android.gms'
&& !details.requested.name.contains('multidex')) {
details.useVersion "x.y.z"
}
}
}
}