title: Resolved versions for app (1.1) and test app (1.3) differ
body: <p>I'm beginner with android and gradle. I saw this error so I removed the hamcrest dependency from my module gradle but I still see the following error:</p>
  
  <blockquote>
    <p>Error:Execution failed for task ':app:preDebugAndroidTestBuild'.</p>
    
    <blockquote>
      <p>Conflict with dependency 'org.hamcrest:hamcrest-core' in project ':app'. Resolved versions for app (1.1) and test app (1.3)
      differ.</p>
    </blockquote>
  </blockquote>
  
  <p>This dependency is causing the problem:</p>
  
  <pre><code>compile 'com.android.support.test:testing-support-lib:0.1'
  </code></pre>
  
  <p>app grade:</p>
  
  <pre><code>buildscript {
  
      repositories {
          google()
          jcenter()
      }
      dependencies {
          classpath 'com.android.tools.build:gradle:3.0.1'
  
          // NOTE: Do not place your application dependencies here; they belong
          // in the individual module build.gradle files
          classpath 'com.google.gms:google-services:3.1.0'
      }
  }
  
  allprojects {
      repositories {
          google()
          jcenter()
          maven {
              url "https://maven.google.com"
          }
      }
  }
  
  task clean(type: Delete) {
      delete rootProject.buildDir
  }
  </code></pre>
  
  <p>module gradle (I have a single module):</p>
  
  <pre><code>apply plugin: 'com.android.application'
  
  android {
      compileSdkVersion 26
      defaultConfig {
          applicationId "com.example.stavalfi.app1"
          minSdkVersion 18
          targetSdkVersion 26
          versionCode 1
          versionName "1.0"
          testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
      }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
      compileOptions {
          targetCompatibility 1.8
          sourceCompatibility 1.8
      }
  }
  
  dependencies {
      implementation fileTree(dir: 'libs', include: ['*.jar'])
      implementation 'com.android.support:appcompat-v7:26.1.0'
      implementation 'com.android.support.constraint:constraint-layout:1.0.2'
      implementation 'com.android.support:design:26.1.0'
      implementation 'com.google.android.gms:play-services-maps:11.0.4'
      implementation 'com.google.firebase:firebase-database:11.0.4'
      compile 'com.google.firebase:firebase-core:11.0.4'
      testCompile 'junit:junit:4.12'
      testCompile 'org.mockito:mockito-core:1.10.19'
      compile 'com.android.support:support-annotations:22.2.0'
      androidTestCompile 'com.android.support.test:runner:1.0.0'
      androidTestCompile 'com.android.support.test:rules:1.0.0'
      androidTestCompile 'com.android.support.test.espresso:espresso-core:3.0.0'
      compile 'com.android.support.test:testing-support-lib:0.1'
      compile 'com.android.support.test.uiautomator:uiautomator-v18:2.0.0'
  }//testImplementation
  
  
  
  apply plugin: 'com.google.gms.google-services'
  </code></pre>
  
  <p>What I have tried:</p>
  
  <pre><code>//testCompile 'junit:junit:4.12'
  testCompile('junit:junit:4.12') { // Prevent duplication conflicts
      exclude module: 'hamcrest-core'
      exclude module: 'hamcrest-library'
      exclude module: 'hamcrest-integration'
  }
  </code></pre>
  
  <p>But I get the same error.</p>
  
  <p>I also saw this solution but I don't know where to add the configurations exactly:</p>
  
  <p><a href="https://stackoverflow.com/questions/30352553/robolectric-3-0-rc2-hamcrest-core-conflict">Robolectric 3.0-rc2 Hamcrest-core conflict</a> </p>
  
  <p>And I don't see why I need to have this problem if I don't use hamcrest anyway.</p>
  
  <p>Thanks!</p>