我在 android studio 终端中执行 Gradle 命令来运行项目测试。
./gradlew connectedCheck --stacktrace
我收到以下错误:
:app:compileDebugAndroidTestAidl UP-TO-DATE
:app:processDebugAndroidTestManifest
:app:compileDebugAndroidTestRenderscript UP-TO-DATE
:app:generateDebugAndroidTestBuildConfig UP-TO-DATE
:app:generateDebugAndroidTestAssets UP-TO-DATE
:app:mergeDebugAndroidTestAssets UP-TO-DATE
:app:generateDebugAndroidTestResValues UP-TO-DATE
:app:generateDebugAndroidTestResources UP-TO-DATE
:app:mergeDebugAndroidTestResources UP-TO-DATE
:app:processDebugAndroidTestResources
:app:generateDebugAndroidTestSources
:app:compileDebugAndroidTestJavaWithJavac
:app:compileDebugAndroidTestNdk UP-TO-DATE
:app:compileDebugAndroidTestSources
:app:transformClassesWithJarMergingForDebugAndroidTest FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':loginsdk:transformClassesWithJarMergingForDebugAndroidTest'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: org/mockito/AdditionalAnswers.class
Try:
Run with --info or --debug option to get more log output.
Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:transformClassesWithJarMergingForDebugAndroidTest'.
Caused by: com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: org/mockito/AdditionalAnswers.class
at com.android.build.gradle.internal.transforms.JarMergingTransform.transform(JarMergingTransform.java:123)
at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:151)
at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:148)
at com.android.builder.profile.ThreadRecorder$1.record(ThreadRecorder.java:55)
... 69 more
Caused by: java.util.zip.ZipException: duplicate entry: org/mockito/AdditionalAnswers.class
at com.android.build.gradle.internal.transforms.JarMerger.addJar(JarMerger.java:143)
at com.android.build.gradle.internal.transforms.JarMergingTransform.transform(JarMergingTransform.java:113)
... 72 more
BUILD FAILED