After adding Multidex, tests through the console stopped running. If run from a package or class, then everything works. And through the console there. The application itself is going.

Part logcat:

> Task :app:connectedDebugAndroidTest 01:55:57 V/ddms: execute: running am get-config 01:55:58 V/ddms: execute 'am get-config' on 'YT9118WPMT' : EOF hit. Read: -1 01:55:58 V/ddms: execute: returning 01:55:58 D/app-debug-androidTest.apk: Uploading app-debug-androidTest.apk onto device 'YT9118WPMT' 01:55:58 D/Device: Uploading file onto device 'YT9118WPMT' 01:56:00 V/ddms: execute: running pm install -r -t "/data/local/tmp/app-debug-androidTest.apk" 01:56:15 V/ddms: execute 'pm install -r -t "/data/local/tmp/app-debug-androidTest.apk"' on 'YT9118WPMT' : EOF hit. Read: -1 01:56:15 V/ddms: execute: returning 01:56:15 V/ddms: execute: running rm "/data/local/tmp/app-debug-androidTest.apk" 01:56:15 V/ddms: execute 'rm "/data/local/tmp/app-debug-androidTest.apk"' on 'YT9118WPMT' : EOF hit. Read: -1 01:56:15 V/ddms: execute: returning 01:56:15 I/RemoteAndroidTest: Running am instrument -w -r com.app.test/android.support.test.runner.AndroidJUnitRunner on D5803 - 6.0.1 01:56:15 V/ddms: execute: running am instrument -w -r com.app.test/android.support.test.runner.AndroidJUnitRunner 01:56:18 V/InstrumentationResultParser: INSTRUMENTATION_RESULT: shortMsg=java.lang.NoClassDefFoundError 01:56:18 I/InstrumentationResultParser: test run failed: 'Instrumentation run failed due to 'java.lang.NoClassDefFoundError'' Starting 0 tests on D5803 - 6.0.1 Tests on D5803 - 6.0.1 failed: Instrumentation run failed due to 'java.lang.NoClassDefFoundError' 01:56:18 V/InstrumentationResultParser: INSTRUMENTATION_RESULT: longMsg=java.lang.NoClassDefFoundError: net.fortuna.ical4j.model.parameter.AbstractParameterFactory 01:56:18 V/InstrumentationResultParser: INSTRUMENTATION_CODE: 0 01:56:19 V/InstrumentationResultParser: 01:56:19 V/ddms: execute 'am instrument -w -r com.app.test/android.support.test.runner.AndroidJUnitRunner' on 'YT9118WPMT' : EOF hit. Read: -1 01:56:19 V/ddms: execute: returning com.android.builder.testing.ConnectedDevice > No tests found.[D5803 - 6.0.1] FAILED 

Part of build.gradle:

  apply plugin: 'com.android.library' apply plugin: "jacoco" android { compileSdkVersion 27 buildToolsVersion "27.0.3" defaultConfig { minSdkVersion 19 targetSdkVersion 27 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" multiDexEnabled = true } buildTypes { release { minifyEnabled false multiDexKeepFile file('multidex-config.txt') multiDexKeepProguard file('multidex-config.pro') } } 

    1 answer 1

    Don't use MultiDexTestRunner , which is deprecated; use AndroidJUnitRunner instead.

    https://developer.android.com/studio/build/multidex#testing


    If in Russian: Do not use outdated MultiDexTestRunner ; instead use AndroidJUnitRunner

     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
    • The same state of affairs remains. I originally used AndroidJUnitRunner . Later in the course of the experiments I tried MultiDexTestRunner - Ivan
    • What - and the error is the same? - woesss
    • By the way, no. There was java.lang.NoClassDefFoundError Updated a question. Does this mean multidex-config.txt is not correct then? - Ivan