Could not find ProxyFrameworkImpl by name

I am working on Android Studio 1.3.1 with gradle 2.2.1. My application was created on an eclipse and then switched to AS. I am doing tests using Mockito, PowerMock and JUnit. I have a problem with ProxyFrameworkImpl , I am sure that my banks contain this class - I found it in the project explorer in the "External Libraries" section.

Debug log:

java.lang.IllegalStateException: Extension API internal error: org.powermock.api.extension.proxyframework.ProxyFrameworkImpl could not be located in classpath. at org.powermock.tests.utils.impl.AbstractTestSuiteChunkerImpl.registerProxyframework(AbstractTestSuiteChunkerImpl.java:142) at org.powermock.tests.utils.impl.AbstractTestSuiteChunkerImpl.chunkClass(AbstractTestSuiteChunkerImpl.java:173) at org.powermock.tests.utils.impl.AbstractTestSuiteChunkerImpl.<init>(AbstractTestSuiteChunkerImpl.java:92) at org.powermock.tests.utils.impl.AbstractTestSuiteChunkerImpl.<init>(AbstractTestSuiteChunkerImpl.java:85) at org.powermock.modules.junit4.common.internal.impl.JUnit4TestSuiteChunkerImpl.<init>(JUnit4TestSuiteChunkerImpl.java:49) at org.powermock.modules.junit4.common.internal.impl.AbstractCommonPowerMockRunner.<init>(AbstractCommonPowerMockRunner.java:32) at org.powermock.modules.junit4.PowerMockRunner.<init>(PowerMockRunner.java:34) at java.lang.reflect.Constructor.newInstance(Native Method) at java.lang.reflect.Constructor.newInstance(Constructor.java:288) at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:104) at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:86) at android.support.test.internal.runner.junit4.AndroidAnnotatedBuilder.runnerForClass(AndroidAnnotatedBuilder.java:51) at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59) at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26) at org.junit.runner.Computer.getRunner(Computer.java:40) at org.junit.runner.Computer$1.runnerForClass(Computer.java:31) at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59) at org.junit.runners.model.RunnerBuilder.runners(RunnerBuilder.java:101) at org.junit.runners.model.RunnerBuilder.runners(RunnerBuilder.java:87) at org.junit.runners.Suite.<init>(Suite.java:81) at org.junit.runner.Computer.getSuite(Computer.java:28) at android.support.test.internal.runner.TestRequestBuilder.classes(TestRequestBuilder.java:598) at android.support.test.internal.runner.TestRequestBuilder.build(TestRequestBuilder.java:578) at android.support.test.runner.AndroidJUnitRunner.buildRequest(AndroidJUnitRunner.java:542) at android.support.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:269) at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1837) 

The dependencies in my gradle.build file consist of jars with powermock, mockito, junit and espresso:

  compile fileTree(include: '*.jar', dir: 'libs') compile project(':google-play-services_lib') compile('junit:junit:4.12') { exclude group: 'org.hamcrest' exclude group: 'org.objenesis' } compile('com.android.support.test.espresso:espresso-core:2.0') { exclude group: 'javax.inject' exclude group: 'org.hamcrest' exclude group: 'org.junit' exclude module: 'junit-dep' } compile('org.powermock:powermock:1.6.2') { exclude group: 'org.objenesis' exclude group: 'org.junit' exclude group: 'org.hamcrest' } compile('org.powermock:powermock-module-junit4:1.6.2') { exclude group: 'org.objenesis' exclude group: 'org.junit' exclude group: 'org.hamcrest' exclude module: 'powermock-core' } compile('cglib:cglib:2.2.2') { exclude group: 'org.objenesis' exclude group: 'org.junit' exclude group: 'org.hamcrest' } compile('org.powermock:powermock-api-mockito:1.5.5') { exclude group: 'org.objenesis' exclude group: 'org.junit' exclude group: 'org.hamcrest' } 

I tried to add this class to another jar in the gradle cache, but I got an error like "duplicate dependency".

+4
source share

All Articles