Runtime error PowerMock + Mockito: ProxyFrameworkImpl could not be located in classpath
<p>I am trying to use PowerMock with the Android InstrumentTestCase
Since my test runs on an Android device the libraries needs to be added to the apk.</p>
<p>I encounter big issues with powermock+mockito and Dex files.
I have a runtime error with only powermock+mockito in my dependencies:</p>
<pre><code>org.powermock.api.extension.proxyframework.ProxyFrameworkImpl could not be located in classpath.
</code></pre>
<p>And a compilation error if I include either cglib/cglib-nodep (has suggested in <a href="https://stackoverflow.com/questions/11223640/mockito-easymock-noclassdeffounderrornet-sf-cglib-proxy-enhancer">answers</a>):</p>
<pre><code>com.android.dex.DexException: Multiple dex files define Lnet/sf/cglib/beans/BeanCopier$BeanCopierKey
</code></pre>
<p>Here is a part of my gradle.build:</p>
<pre><code>androidTestCompile 'com.android.support.test:runner:0.3'
androidTestCompile 'org.powermock:powermock-api-mockito:1.6.4'
androidTestCompile 'org.powermock:powermock-module-junit4:1.6.4'
androidTestCompile 'cglib:cglib-nodep:3.2.0'
androidTestCompile 'cglib:cglib:3.2.0'
</code></pre>
<p>What am I missing ?</p>
<p>Thanks in advance!</p>