square / assertj-android

A set of AssertJ helpers geared toward testing Android.
https://square.github.io/assertj-android/
Apache License 2.0
1.58k stars 156 forks source link

Error:Execution failed for task ':app:preDebugAndroidTestBuild'. > Conflict with dependency 'com.android.support:support-annotations' in project ':app'. Resolved versions for app (26.1.0) and test app (27.1.1) differ. See https://d.android.com/r/tools/test-apk-dependency-conflicts.html for details. #227

Closed vishald19 closed 5 years ago

vishald19 commented 5 years ago

Anyone Please help me out Screenshot (6) with this!!!.Unable to continue with the projects.

JakeWharton commented 5 years ago

The error message is pretty clear as to what's happening here. You need to force the support library dependency to be the same version in both your main sources and test sources. You can do this by specifying the same version in both configurations, or by using a resolution strategy like:


configurations.all {
  resolutionStrategy {
    eachDependency { details ->
      // Force all of the primary support libraries to use the same version.
      if (details.requested.group == 'com.android.support') {
        details.useVersion versions.supportLibrary
      }
    }
  }
}
vishald19 commented 5 years ago

Thank you for your response!!!

On Tue, Apr 9, 2019, 12:17 AM Jake Wharton notifications@github.com wrote:

Closed #227 https://github.com/square/assertj-android/issues/227.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/square/assertj-android/issues/227#event-2260656762, or mute the thread https://github.com/notifications/unsubscribe-auth/AvDEzb62Z7LlnlRZZoH5vzPKd2HsvJL3ks5ve463gaJpZM4cgDBc .