1

After updating to Gradle version 3.0.0 and Android Studio 3.0 I'm receiving the following error:

Error:Execution failed for task ':app:appNameDebugBuild'.

Android dependency 'com.android.support:recyclerview-v7' has different version for the compile (24.0.0) and runtime (25.4.0) classpath. You should manually set the same version via DependencyResolution

I did search for anything with the version 24.0.0 in my project but didnt find anything. On gradle I define a variable with the version 25.4.0 and use it on compile/implementation dependencies.

How can I check which library or module is using the version 24.0.0? How can i work around this?

Bugdr0id
  • 2,962
  • 6
  • 35
  • 59

1 Answers1

4

Try adding this subprojects block to your main/top level gradle file. Clean and Build again.

allprojects {
    repositories {
       //...
    }

    subprojects {
        project.configurations.all {
            resolutionStrategy.eachDependency { details ->
                if (details.requested.group == 'com.android.support'
                && !details.requested.name.contains('multidex') ) {
                    details.useVersion "25.4.0"
                }
            }
        }
    }
}
Oğuzhan Döngül
  • 7,856
  • 4
  • 38
  • 52
  • Thanks for the answer, good approach! But still get the same error. I still can't figure out who is trying to get this 24.0.0 – Bugdr0id Nov 06 '17 at 15:07
  • It did solve the problem. I wasn't applying this code to main gradle file. – Bugdr0id Nov 06 '17 at 17:01