Launching multi-screen espresso .APK

When running Espresso tests with ./gradlew connectedDebugAndroidTestus, we have this problem:

com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexIndexOverflowException: method identifier not in [0, 0xffff]: 65536

Since we use Multidex in the main application and just add the Espresso dependencies on the instrumental test, we don’t understand why this does not work: · (In addition, if we run tests through IntelliJ instead of from Gradle, it works: · |

By the way, we need to run them through Gradle in order to automate them in the CI tool.

Additional Information? There is a link to a related issue on the Google tracker: https://issuetracker.google.com/issues/37017515 : sad:

+4
source share
1 answer

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.

+3

Source: https://habr.com/ru/post/1676240/


All Articles