Android. How to use Espresso 2.2.2 with support library 24.1.1?
<p>This is my test:</p>

<pre><code>@RunWith(AndroidJUnit4.class)
@MediumTest
public class MainActivityTest {

    @Rule
    public ActivityTestRule&lt;MainActivity&gt; mainActivityActivityTestRule = new ActivityTestRule&lt;MainActivity&gt;(MainActivity.class);

    @Test
    public void buttonShouldBePresent(){
        Intents.init();
        onView(withId(R.id.button)).perform(click());
        intended(hasComponent(SecondActivity.class.getName()));
    }


}
</code></pre>

<p>I have these dependencies:</p>

<pre><code>dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:24.1.1'
    compile 'com.android.support:recyclerview-v7:24.1.1'
    compile 'com.android.support:cardview-v7:24.1.1'
    compile 'com.android.support:preference-v7:24.1.1'
    compile 'com.android.support:design:24.1.1'

    androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
    androidTestCompile 'com.android.support.test.espresso:espresso-intents:2.2.2'
    androidTestCompile 'com.android.support.test:runner:0.5'

}
</code></pre>

<p>I am getting this error:</p>

<pre><code>Error:Conflict with dependency 'com.android.support:support-annotations'. Resolved versions for app (24.1.1) and test app (23.1.1) differ. See http://g.co/androidstudio/app-test-app-conflict for details.
</code></pre>

<p>Tried to use support library with earlier version (could import successfully but cannot use TextInputEditText):</p>

<pre><code>dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.1.1'

    androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
    androidTestCompile 'com.android.support.test.espresso:espresso-intents:2.2.2'
    androidTestCompile 'com.android.support.test:runner:0.5'

}

allprojects {
    repositories {
        jcenter()
    }
    configurations.all {
        resolutionStrategy.force('com.android.support:support-annotations:23.1.1')
    }
}
</code></pre>

<p>I could import earlier version, but 2 reasons which makes me unable to use earlier version.</p>

<ol>
<li><p>I am using TextInputEditText which is not available in earlier version</p></li>
<li><p>Project requirement</p>

<ul>
<li>Android Studio 2.1+</li>
<li>Android SDK Platform-tools 24+</li>
<li>Android SDK Tools 25+</li>
<li>SDK Build Tools 24.0.0</li>
<li>Android Support Repository 34+</li>
<li>Android SDK Platform 24</li>
</ul></li>
</ol>

<p>How can I solve this problem without lowering support library version?</p>