作者:wujianhong61391 | 来源:互联网 | 2023-08-10 09:04
Description(RobolectricTestRunner::class)returnsthefollowingerror.
Description
(RobolectricTestRunner::class) returns the following error.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| java.lang.NoSuchMethodError: No virtual method getAnnotatedParameterTypes()[Ljava/lang/reflect/AnnotatedType; in class Ljava/lang/reflect/Executable; or its super classes (declaration of 'java.lang.reflect.Executable' appears in /apex/com.android.runtime/javalib/core-oj.jar)
at org.robolectric.util.inject.Injector.resolveDependencies(Injector.java:286)
at org.robolectric.util.inject.Injector.inject(Injector.java:248)
at org.robolectric.util.inject.Injector.lambda$memoized$1$Injector(Injector.java:232)
at org.robolectric.util.inject.-$$Lambda$Injector$9adlN9c5JSO7J0D33kkXKLULCCM.get(Unknown Source:4)
at org.robolectric.util.inject.Injector$MemoizingProvider.get(Injector.java:498)
at org.robolectric.util.inject.Injector.getInstanceInternal(Injector.java:224)
at org.robolectric.util.inject.Injector.getInstance(Injector.java:208)
at org.robolectric.util.inject.Injector.getInstance(Injector.java:202)
at org.robolectric.internal.SandboxTestRunner.(SandboxTestRunner.java:75)
at org.robolectric.RobolectricTestRunner.(RobolectricTestRunner.java:103)
at org.robolectric.RobolectricTestRunner.(RobolectricTestRunner.java:98)
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:104)
at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:86)
at androidx.test.internal.runner.junit4.AndroidAnnotatedBuilder.runnerForClass(AndroidAnnotatedBuilder.java:63)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26)
at androidx.test.internal.runner.AndroidRunnerBuilder.runnerForClass(AndroidRunnerBuilder.java:153)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
at androidx.test.internal.runner.TestLoader.doCreateRunner(TestLoader.java:73)
at androidx.test.internal.runner.TestLoader.getRunnersFor(TestLoader.java:105)
at androidx.test.internal.runner.TestRequestBuilder.build(TestRequestBuilder.java:804)
at androidx.test.runner.AndroidJUnitRunner.buildRequest(AndroidJUnitRunner.java:575)
at androidx.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:393)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:2204)
Tests ran to completion.
|
Navigating into Injector.java, getAnnotatedParameterTypes method is marked as unresolved.