This happens because some libraries depend on the "X or newer" version of the Android support libraries. A documented solution, to avoid conflicts is the following, put this at the end of the build.Radle of the app module:
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.android.support') {
details.useVersion '26.1.0'
}
}
}
This will solve your problem. Unfortunately some libraries do not yet have a newer version, which causes these conflicts.
Edit1:
What you can try to see is that there is no conflict, and a better solution than the one above is to add the dependency with the minor version that generates the conflict and check if you have the updated version, in your case you have version 28.0.0
Then on dependencies add:
api 'com.android.support:support-v4:28.0.0'
You can see other libraries that have the 26.1.0 version and do the same for them in dependency.
A dependency on.google.android.gms:.....
includes libraries with version 26.1.0 which causes conflict.
So to sum up, the first option transforms the version of all dependencies 'com.android.support'and changes the version to 26.1.0, while the second option adds to the library the latest version of the library that was generating the conflict.
You can see that they themselves help this method:
Githubgoogleplayservices
What dependencies are you using?
– Murillo Comino
I edited and put the dependencies in the question, thank you.
– Edson Santos
I edited my reply and put another option which I think the most correct one, if it works rs. Send feedback if you have solved or not.
– Murillo Comino
They were both compatible: com.android.support:support-media-compat:26.1.0 and com.android.support:support-v4:26.1.0. The first resolved by adding the com.android.support:support-media-compat:28.0.0 api to the dependencies. The second one didn’t resolve because I’m using with.android.support:appcompat-v7:28.0.0 and doesn’t have com.android.support:support-v4:28.0.0.
– Edson Santos
I edited my reply again, remove the dependency I passed earlier and add the support-v4:28.0.0 . This is from one of the contributors of gms:play-services. It works well for me
– Murillo Comino