From cfc836034a61bf1f73f0f1e2c3cf56f4456879e8 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Ricau Date: Mon, 20 May 2024 16:48:31 -0700 Subject: [PATCH] Add multidex to UI tests --- gradle/libs.versions.toml | 1 + leakcanary/leakcanary-android-instrumentation/build.gradle | 2 ++ .../src/androidTest/AndroidManifest.xml | 4 +++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 608a5088ab..43265b80bf 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -41,6 +41,7 @@ kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = # and they'll automatically resolve to higher version without having to necessarily resort to a # resolution strategy. androidX-fragment = { module = "androidx.fragment:fragment", version = "1.0.0" } +androidX-multidex = { module = "androidx.multidex:multidex", version = "2.0.1" } # Exposed transitively, avoid increasing androidX-startup = { module = "androidx.startup:startup-runtime", version = "1.0.0" } androidX-test-core = { module = "androidx.test:core", version = "1.4.0" } diff --git a/leakcanary/leakcanary-android-instrumentation/build.gradle b/leakcanary/leakcanary-android-instrumentation/build.gradle index 16c7a58031..5bbf189368 100644 --- a/leakcanary/leakcanary-android-instrumentation/build.gradle +++ b/leakcanary/leakcanary-android-instrumentation/build.gradle @@ -15,6 +15,7 @@ dependencies { androidTestImplementation projects.objectWatcher.objectWatcherAndroid // Plumber auto installer for running tests androidTestImplementation projects.plumber.plumberAndroid + androidTestImplementation libs.androidX.multidex androidTestImplementation libs.androidX.test.core androidTestImplementation libs.androidX.test.espresso androidTestImplementation libs.androidX.test.rules @@ -28,6 +29,7 @@ android { targetSdk versions.compileSdk minSdk versions.minSdk testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + multiDexEnabled true } buildFeatures.buildConfig = false namespace 'com.squareup.leakcanary.instrumentation' diff --git a/leakcanary/leakcanary-android-instrumentation/src/androidTest/AndroidManifest.xml b/leakcanary/leakcanary-android-instrumentation/src/androidTest/AndroidManifest.xml index 2743ca7e1c..700c2fc2b0 100644 --- a/leakcanary/leakcanary-android-instrumentation/src/androidTest/AndroidManifest.xml +++ b/leakcanary/leakcanary-android-instrumentation/src/androidTest/AndroidManifest.xml @@ -16,7 +16,9 @@ --> - +