The task connectedDebugAndroidTestwill try to build test apks for each module in the project, so if the project has several modules, you need to enable multidex in each of them. This is usually done during installation.
android.defaultConfig.multiDexEnabled true
in build.gradlefor each module.
, , . , app , app:connectedDebugAndroidTest , . , , Android Studio, , , , , IDE.