Skip to content Skip to sidebar Skip to footer

Android.support Libraries Not Compatible Together After Updation

I just updated my gradle plugin and then got warnings telling me to update some of my implementations. I just upgraded both com.android.support:appcompat and com.android.suppo

Solution 1:

Put something like this in your root project:

Map<String,String> versionOverrides = [
        'com.android.support:support-v7' : '27.1.1'
        ...
]

def overrideDependencies = { Project project ->
    project.configurations.all {
        // See https://docs.gradle.org/current/dsl/org.gradle.api.artifacts.ResolutionStrategy.html
        resolutionStrategy {
            eachDependency { DependencyResolveDetails details ->
                String overrideVersion = versionOverrides.get(details.requested.group + ":" + details.requested.name)
                if (overrideVersion != null && details.requested.version != overrideVersion) {
                    logger.debug("Overriding dependency ${details.requested.group}:${details.requested.name} " +
                            "version ${details.requested.version} --> $overrideVersion")
                    details.useVersion overrideVersion
                }
            }
        }
    }
}

subprojects { project ->
    overrideDependencies(project)
}

Solution 2:

The conflicted dependencies probably comes from Firebase and Google play service library. You need to check it with:

./gradlew app:dependencies

then you can override them by adding the support libraries to your dependencies block. You don't need to use exclude

Post a Comment for "Android.support Libraries Not Compatible Together After Updation"