Android问题“程序类型已存在:org.powermock.api.mockito.expectation.WithExpectedArguments”

时间:2018-07-05 11:52:31

标签: java android java-8 android-studio-3.0

Android issue "Program type already present: org.powermock.api.mockito.expectation.WithExpectedArguments"

The issue appears when I tried to use the mockito in android test
androidTestImplementation ("org.powermock:powermock-api-mockito2:1.7.4")

The full stack trace

org.gradle.api.tasks.TaskExecutionException: Execution failed for task 
':app:transformDexArchiveWithExternalLibsDexMergerForDebugAndroidTest'.
at 

org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:103)         在org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:73)         在org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)处         在org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:59)         在org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)         在org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:59)         在org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:101)处         在org.gradle.api.internal.tasks.execution.FinalizeInputFilePropertiesTaskExecuter.execute(FinalizeInputFilePropertiesTaskExecuter.java:44)         在org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:88)         在org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:62)处         在org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)         在org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)         在org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)         在org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)         在org.gradle.execution.taskgraph.DefaultTaskGraphExecuter $ EventFiringTaskWorker $ 1.run(DefaultTaskGraphExecuter.java:248)         在org.gradle.internal.progress.DefaultBuildOperationExecutor $ RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)处         在org.gradle.internal.progress.DefaultBuildOperationExecutor $ RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)         在org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)         在org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)         在org.gradle.execution.taskgraph.DefaultTaskGraphExecuter $ EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:241)处         在enter code here org.gradle.execution.taskgraph.DefaultTaskGraphExecuter $ EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:230)上         在org.gradle.execution.taskgraph.DefaultTaskPlanExecutor $ TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:123)处         在org.gradle.execution.taskgraph.DefaultTaskPlanExecutor $ TaskExecutorWorker.access $ 200(DefaultTaskPlanExecutor.java:79)         在org.gradle.execution.taskgraph.DefaultTaskPlanExecutor $ TaskExecutorWorker $ 1.execute(DefaultTaskPlanExecutor.java:104)         在org.gradle.execution.taskgraph.DefaultTaskPlanExecutor $ TaskExecutorWorker $ 1.execute(DefaultTaskPlanExecutor.java:98)         在org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:623)处         在org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:578)         在org.gradle.execution.taskgraph.DefaultTaskPlanExecutor $ TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98)         在org.gradle.internal.concurrent.ExecutorPolicy $ CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)         在org.gradle.internal.concurrent.ManagedExecutorImpl $ 1.run(ManagedExecutorImpl.java:46)         在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)         在java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:617)         在org.gradle.internal.concurrent.ThreadFactoryImpl $ ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)         在java.lang.Thread.run(Thread.java:745)     引起原因:java.lang.RuntimeException:com.android.builder.dexing.DexArchiveMergerException:合并dex归档文件时出错:C:\ Projects \ vehicle-profiles \ app \ build \ intermediates \ transforms \ dexBuilder \ androidTest \ debug \ 2。 jar,C:\ Projects \车辆配置文件\ app \ build \ intermediates \ transforms \ dexBuilder \ androidTest \ debug \ 3.jar,C:\ Projects \ vehicle-profiles \ app \ build \ intermediates \ transforms \ dexBuilder \ androidTest \ debug \ 4.jar,C:\ Projects \车辆配置文件\ app \ build \ intermediates \ transforms \ dexBuilder \ androidTest \ debug \ 5.jar,C:\ Projects \ vehicle-profiles \ app \ build \ intermediates \ transforms \ dexBuilder \ androidTest \ debug \ 6.jar,C:\ Projects \ vehicle-profiles \ app \ build \ intermediates \ transforms \ dexBuilder \ androidTest \ debug \ 7.jar,C:\ Projects \ vehicle-profiles \ app \ build \中间体\ transforms \ dexBuilder \ androidTest \ debug \ 8.jar,C:\ Projects \ vehicle-profiles \ app \ build \ intermediates \ transforms \ dexBuilder \ androidTest \ debug \ 9.jar,C:\ Projects \ vehicle-profiles \ app \ build \ intermediates \ transforms \ dexBuilde r \ androidTest \ debug \ 10.jar,C:\ Projects \车辆配置文件\ app \ build \ intermediates \ transforms \ dexBuilder \ androidTest \ debug \ 11.jar,C:\ Projects \ vehicle-profiles \ app \ build \中间体\ transforms \ dexBuilder \ androidTest \ debug \ 12.jar,C:\ Projects \ vehicle-profiles \ app \ build \ intermediates \ transforms \ dexBuilder \ androidTest \ debug \ 13.jar,C:\ Projects \ vehicle-profiles \ app \ build \ intermediates \ transforms \ dexBuilder \ androidTest \ debug \ 14.jar,C:\ Projects \ vehicle-profiles \ app \ build \ intermediates \ transforms \ dexBuilder \ androidTest \ debug \ 15.jar,C:\ Projects \车辆配置文件\ app \ build \ intermediates \ transforms \ dexBuilder \ androidTest \ debug \ 16.jar,C:\ Projects \ vehicle-profiles \ app \ build \ intermediates \ transforms \ dexBuilder \ androidTest \ debug \ 17.jar,C :\ Projects \车辆配置文件\ app \ build \ intermediates \ transforms \ dexBuilder \ androidTest \ debug \ 18.jar,C:\ Projects \ vehicle-profiles \ app \ build \ intermediates \ transforms \ dexBuilder \ androidTest \ debug \ 19 .jar,C:\ Projects \ vehicle-profiles \ app \ build \ intermediates \ transforms \ dexBuilder \ androidTest \ debug \ 20.jar,C:\ Projects \ vehicle-profiles \ app \ build \ intermediates \ transforms \ dexBuilder \ androidTest \ debug \ 21.jar,C:\ Projects \ vehicle-profiles \ app \ build \ intermediates \ transforms \ dexBuilder \ androidTest \ debug \ 22.jar,C:\ Projects \ vehicle-profiles \ app \ build \ intermediates \ transforms \ dexBuilder \ androidTest \ debug \ 23.jar,C:\ Projects \ vehicle-profiles \ app \ build \ intermediates \ transforms \ dexBuilder \ androidTest \ debug \ 24.jar,C:\ Projects \ vehicle-profiles \ app \ build \ intermediates \ transforms \ dexBuilder \ androidTest \ debug \ 25.jar,C:\ Projects \ vehicle-profiles \ app \ build \ intermediates \ transforms \ dexBuilder \ androidTest \ debug \ 26.jar,C:\ Projects \ vehicle-profiles \ app \ build \ intermediates \ transforms \ dexBuilder \ androidTest \ debug \ 27.jar         在com.android.builder.profile.Recorder $ Block.handleException(Recorder.java:55)         在com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:104)         在com.android.build.gradle.internal.pipeline.TransformTask.transform(TransformTask.java:212)         在sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)处         在sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)         在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)         在java.lang.reflect.Method.invoke(Method.java:498)         在org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)         在org.gradle.api.internal.project.taskfactory.IncrementalTask​​Action.doExecute(IncrementalTask​​Action.java:50)         在org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39)         在org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26)         在org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter $ 1.run(ExecuteActionsTaskExecuter.java:124)         在org.gradle.internal.progress.DefaultBuildOperationExecutor $ RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)处         在org.gradle.internal.progress.DefaultBuildOperationExecutor $ RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)         在org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)         在org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)         在org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:113)处         在org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:95)         ...更多33     引起原因:com.android.builder.dexing.DexArchiveMergerException:合并dex归档文件时出错:C:\ Projects \车辆配置文件\ app \ build \ intermediates \ transforms \ dexBuilder \ androidTest \ debug \ 2.jar,C:\ Projects \ vehicle-profiles \ app \ build \ intermediates \ transforms \ dexBuilder \ androidTest \ debug \ 3.jar,C:\ Projects \ vehicle-profiles \ app \ build \ intermediates \ transforms \ dexBuilder \ androidTest \ debug \ 4.jar, C:\ Projects \车辆配置文件\ app \ build \ intermediates \ transforms \ dexBuilder \ androidTest \ debug \ 5.jar,C:\ Projects \车辆配置文件\ app \ build \ intermediates \ transforms \ dexBuilder \ androidTest \ debug \ 6.jar,C:\ Projects \车辆配置文件\ app \ build \ intermediates \ transforms \ dexBuilder \ androidTest \ debug \ 7.jar,C:\ Projects \ vehicle-profiles \ app \ build \ intermediates \ transforms \ dexBuilder \ androidTest \ debug \ 8.jar,C:\ Projects \车辆配置文件\ app \ build \ intermediates \ transforms \ dexBuilder \ androidTest \ debug \ 9.jar,C:\ Projects \ vehicle-profiles \ app \ build \ intermediates \ transforms \ dexBuilder \ androidTest \ debug \ 10.jar, C:\ Projects \车辆配置文件\ app \ build \ intermediates \ transforms \ dexBuilder \ androidTest \ debug \ 11.jar,C:\ Projects \车辆配置文件\ app \ build \ intermediates \ transforms \ dexBuilder \ androidTest \ debug \ 12.jar,C:\ Projects \ vehicle-profiles \ app \ build \ intermediates \ transforms \ dexBuilder \ androidTest \ debug \ 13.jar,C:\ Projects \ vehicle-profiles \ app \ build \ intermediates \ transforms \ dexBuilder \ androidTest \ debug \ 14.jar,C:\ Projects \车辆配置文件\ app \ build \ intermediates \ transforms \ dexBuilder \ androidTest \ debug \ 15.jar,C:\ Projects \ vehicle-profiles \ app \ build \ intermediates \ transforms \ dexBuilder \ androidTest \ debug \ 16.jar,C:\ Projects \ vehicle-profiles \ app \ build \ intermediates \ transforms \ dexBuilder \ androidTest \ debug \ 17.jar,C:\ Projects \ vehicle-profiles \ app \ build \ intermediates \ transforms \ dexBuilder \ androidTest \ debug \ 18.jar,C:\ Projects \ vehicle-profiles \ app \ build \ intermediates \ transforms \ dexBuilder \ androidTest \ debug \ 19.jar,C:\ Projects \ vehicle- profiles \ app \ build \ intermediates \ transforms \ dexBuilder \ androidTest \ debu g \ 20.jar,C:\ Projects \ vehicle-profiles \ app \ build \ intermediates \ transforms \ dexBuilder \ androidTest \ debug \ 21.jar,C:\ Projects \ vehicle-profiles \ app \ build \ intermediates \ transforms \ dexBuilder \ androidTest \ debug \ 22.jar,C:\ Projects \ vehicle-profiles \ app \ build \ intermediates \ transforms \ dexBuilder \ androidTest \ debug \ 23.jar,C:\ Projects \ vehicle-profiles \ app \ build \中间体\ transforms \ dexBuilder \ androidTest \ debug \ 24.jar,C:\ Projects \ vehicle-profiles \ app \ build \ intermediates \ transforms \ dexBuilder \ androidTest \ debug \ 25.jar,C:\ Projects \ vehicle-profiles \ app \ build \ intermediates \ transforms \ dexBuilder \ androidTest \ debug \ 26.jar,C:\ Projects \ vehicle-profiles \ app \ build \ intermediates \ transforms \ dexBuilder \ androidTest \ debug \ 27.jar         在com.android.builder.dexing.D8DexArchiveMerger.getExceptionToRethrow(D8DexArchiveMerger.java:124)         在com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives(D8DexArchiveMerger.java:109)         在com.android.build.gradle.internal.transforms.DexMergerTransformCallable.call(DexMergerTransformCallable.java:101)         在com.android.build.gradle.internal.transforms.ExternalLibsMergerTransform.transform(ExternalLibsMergerTransform.kt:123)         在com.android.build.gradle.internal.pipeline.TransformTask $ 2.call(TransformTask.java:221)         在com.android.build.gradle.internal.pipeline.TransformTask $ 2.call(TransformTask.java:217)         在com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:102)         ...还有49个     引起原因:com.android.tools.r8.CompilationFailedException:编译无法完成         在com.android.tools.r8.utils.ExceptionUtils.withCompilationHandler(ExceptionUtils.java:76)         在com.android.tools.r8.utils.ExceptionUtils.withD8CompilationHandler(ExceptionUtils.java:45)         在com.android.tools.r8.D8.run(D8.java:88)         在com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives(D8DexArchiveMerger.java:107)         ...另外54个     引起原因:com.android.tools.r8.utils.AbortException         在com.android.tools.r8.utils.Reporter.failIfPendingErrors(Reporter.java:77)         在com.android.tools.r8.utils.Reporter.fatalError(Reporter.java:58)         在com.android.tools.r8.utils.ExceptionUtils.withCompilationHandler(ExceptionUtils.java:67)         ...还有57个

0 个答案:

没有答案