由于NoClassDefFoundError而导致的工具测试失败

我从今天开始在调试模式下对我的kotlin应用程序进行多重分解,因为库迫使我这样做。 我的问题是,我的用户界面测试不工作了。 我也正在缩小我的apk。

我收到以下错误:

FATAL EXCEPTION: MockWebServer Process: [package], PID: 19446 java.lang.NoClassDefFoundError: Failed resolution of: Lkotlin/collections/CollectionsKt; at [package].activity.MockedServerTestsBase$dispatcher$1.dispatch(Unknown Source) at okhttp3.mockwebserver.MockWebServer$3.processOneRequest(Unknown Source) at okhttp3.mockwebserver.MockWebServer$3.processConnection(Unknown Source) at okhttp3.mockwebserver.MockWebServer$3.execute(Unknown Source) at okhttp3.internal.NamedRunnable.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607) at java.lang.Thread.run(Thread.java:761) Caused by: java.lang.ClassNotFoundException: Didn't find class "kotlin.collections.CollectionsKt" on path: DexPathList[[zip file "/system/framework/android.test.runner.jar", zip file "/data/app/[package].test-2/base.apk", zip file "/data/app/[package]-1/base.apk"],nativeLibraryDirectories=[/data/app/[package].test-2/lib/x86, /data/app/[package]-1/lib/x86, /system/lib, /vendor/lib]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56) at java.lang.ClassLoader.loadClass(ClassLoader.java:380) at java.lang.ClassLoader.loadClass(ClassLoader.java:312) at [package].activity.MockedServerTestsBase$dispatcher$1.dispatch(Unknown Source) at okhttp3.mockwebserver.MockWebServer$3.processOneRequest(Unknown Source) at okhttp3.mockwebserver.MockWebServer$3.processConnection(Unknown Source) at okhttp3.mockwebserver.MockWebServer$3.execute(Unknown Source) at okhttp3.internal.NamedRunnable.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607) at java.lang.Thread.run(Thread.java:761) 

有没有人收到这个错误谁也使用OkHttp MockWebServer? 或者是其他东西。 也许我错过了一些proguard规则?

我的应用程序/ build.gradle文件:

 android { defaultConfig { testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { debug { debuggable true minifyEnabled true dexOptions { multiDexEnabled true } } } dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib:1.1.60" androidTestImplementation "com.squareup.okhttp3:mockwebserver:3.8.1" androidTestImplementation "com.android.support.test:runner:1.0.1" androidTestImplementation "com.android.support.test:rules:1.0.1" } 

如果我的方法是正确的,我会很感激任何帮助和/或讨论。

Kotlin language will be the best programming language for Android.