square / assertj-android

A set of AssertJ helpers geared toward testing Android.

Home Page:https://square.github.io/assertj-android/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

vishald19 opened this issue · comments

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

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
      }
    }
  }
}