如何在 Android Studio 中解决 "multiple dex files define Lorg/junit/runner/Runner"

How to resolve "multiple dex files define Lorg/junit/runner/Runner" in Android Studio

我正在尝试 运行 在 Android Studio 中进行仪器测试。

我已经研究并尝试了很多,但我无法克服这个错误信息。

我的模块依赖项:

(编译)

+--- com.crashlytics.sdk.android:crashlytics:2.5.5
|    +--- com.crashlytics.sdk.android:answers:1.3.6
|    |    \--- io.fabric.sdk.android:fabric:1.3.10
|    +--- com.crashlytics.sdk.android:crashlytics-core:2.3.8
|    |    +--- com.crashlytics.sdk.android:answers:1.3.6 (*)
|    |    \--- io.fabric.sdk.android:fabric:1.3.10
|    +--- io.fabric.sdk.android:fabric:1.3.10
|    \--- com.crashlytics.sdk.android:beta:1.1.4
+--- com.jakewharton:butterknife:7.0.1
+--- io.realm:realm-android:0.87.5
+--- com.android.support:appcompat-v7:23.0.1
|    \--- com.android.support:support-v4:23.0.1
|         \--- com.android.support:support-annotations:23.0.1
+--- com.android.support:cardview-v7:23.0.1
+--- com.android.support:recyclerview-v7:23.0.1
|    +--- com.android.support:support-v4:23.0.1 (*)
|    \--- com.android.support:support-annotations:23.0.1
+--- com.android.support:design:23.0.1
|    +--- com.android.support:support-v4:23.0.1 (*)
|    \--- com.android.support:appcompat-v7:23.0.1 (*)
+--- io.reactivex:rxandroid:1.1.0
|    \--- io.reactivex:rxjava:1.1.0
+--- io.reactivex:rxjava:1.1.0
\--- project :domain

(android测试)

+--- org.jmockit:jmockit:1.22
\--- com.android.support.test:runner:0.4
     +--- com.android.support:support-annotations:23.0.1
     +--- junit:junit:4.12
     |    \--- org.hamcrest:hamcrest-core:1.3
     \--- com.android.support.test:exposed-instrumentation-api-publish:0.4

感谢任何帮助

简短的回答是:您无法(轻松)修复此问题,因为 JMockit 依赖项已损坏。

您可以找到详细的解释 here