Android Espresso testing 'Cannot resolve symbol 'InstrumentationRegistry'' : <p>I'm trying to import        </p>

<pre><code> import android.support.test.InstrumentationRegistry;
</code></pre>

<p>my build.gradle file</p>

<pre><code>androidTestCompile 'com.android.support.test:testing-support-lib:0.1'
androidTestCompile 'com.android.support.test:runner:0.2'
androidTestCompile 'com.android.support.test:rules:0.2'
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
</code></pre>

<p>in default config:</p>

<pre><code>defaultConfig {
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
</code></pre>

<p>Is there a library I'm missing here? I'm trying to import InstrumentationRegistry but it doesn't recognise it! </p>
