Duane
Duane

Reputation: 86

Anko version dependencies (com.android.support.support-v4:27.1.1)

I am trying to migrate my app to targeting android sdk 28.

I think I am getting tripped up by the Anko dependency on support 27.1.1 which occurs here

I am failing with conflicting dependencies on com.android.support:support-v4:27.1.1 and com.android.support:animated-vector-drawable:28.0.0

If I try to match Anko's use of 27.1.1, then my build complains that I should not use a support version lower than my target version.

So I am puzzled at where to go from here. Just not target sdk28 if I am using Anko :-( ?

Upvotes: 1

Views: 156

Answers (1)

pudding
pudding

Reputation: 11

This was bugging me as well. First I made sure the Android support libraries were up-to-date and added each of these from the Android support libraries packages https://developer.android.com/topic/libraries/support-library/packages

Then added the following to the end of build.gradle in the app:

configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        def requested = details.requested
        if (requested.group == 'com.android.support') {
            if (!requested.name.startsWith("multidex")) {
                details.useVersion '28.0.0'
            }
        }
    }
}

Hope this works for you!

Upvotes: 1

Related Questions