From 895ff5c391051a136a8aa6e180173f528f2187be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Irfan=20=C3=96m=C3=BCr?= Date: Wed, 12 Nov 2025 01:27:02 +0300 Subject: [PATCH 1/8] Remove apache.http.client.android dependency Removes the `apache.http.client.android` dependency from `androidTestImplementation` configurations. --- WooCommerce/build.gradle | 1 - 1 file changed, 1 deletion(-) diff --git a/WooCommerce/build.gradle b/WooCommerce/build.gradle index 81fe10808c6..8fbd4c78031 100644 --- a/WooCommerce/build.gradle +++ b/WooCommerce/build.gradle @@ -349,7 +349,6 @@ dependencies { exclude group: 'asm', module: 'asm' exclude group: 'org.json', module: 'json' } - androidTestImplementation(libs.apache.http.client.android) constraints { androidTestImplementation(libs.wiremock) { because("newer versions of WireMock use Java APIs not available on Android") From 324ecd8c598af2722e63cec89a497dff4abc527f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Irfan=20=C3=96m=C3=BCr?= Date: Wed, 12 Nov 2025 02:03:50 +0300 Subject: [PATCH 2/8] Revert "Remove apache.http.client.android dependency" This reverts commit 895ff5c391051a136a8aa6e180173f528f2187be. --- WooCommerce/build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/WooCommerce/build.gradle b/WooCommerce/build.gradle index 8fbd4c78031..81fe10808c6 100644 --- a/WooCommerce/build.gradle +++ b/WooCommerce/build.gradle @@ -349,6 +349,7 @@ dependencies { exclude group: 'asm', module: 'asm' exclude group: 'org.json', module: 'json' } + androidTestImplementation(libs.apache.http.client.android) constraints { androidTestImplementation(libs.wiremock) { because("newer versions of WireMock use Java APIs not available on Android") From b49cd6bf364388ca3e6788f684700decc63adc83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Irfan=20=C3=96m=C3=BCr?= Date: Wed, 12 Nov 2025 02:24:18 +0300 Subject: [PATCH 3/8] Configure dependency analysis to ignore false positives --- WooCommerce/build.gradle | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/WooCommerce/build.gradle b/WooCommerce/build.gradle index 81fe10808c6..dd61d18f7af 100644 --- a/WooCommerce/build.gradle +++ b/WooCommerce/build.gradle @@ -514,4 +514,19 @@ def isLeakCanaryEnabled() { return developerProperties.get("enable_leak_canary") ?: true } +dependencyAnalysis { + issues { + onUnusedDependencies { + // This dependency is actually needed otherwise UI tests will crash with a runtime exception. + exclude(libs.apache.http.client.android.get().module.toString()) + // This dependency is actually needed otherwise it will cause the app to fail to build. + exclude(libs.androidx.hilt.navigation.compose.get().module.toString()) + // This dependency is actually needed otherwise it will cause the app to fail to build. + exclude(libs.androidx.work.runtime.ktx.get().module.toString()) + // This dependency is actually needed otherwise it will cause the app to fail to build. + exclude(libs.google.protobuf.kotlinlite.get().module.toString()) + } + } +} + apply from: '../config/gradle/build_optimization.gradle' From a127ee81457bf98e5d099340c075c78cd8d498a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Irfan=20=C3=96m=C3=BCr?= Date: Wed, 12 Nov 2025 03:09:35 +0300 Subject: [PATCH 4/8] Exclude unused dependencies from analysis for Woocommerce-Wear Configures the dependency analysis plugin to ignore certain dependencies that are reported as unused but are required at runtime. --- WooCommerce-Wear/build.gradle | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/WooCommerce-Wear/build.gradle b/WooCommerce-Wear/build.gradle index 6c225399529..40264d10bae 100644 --- a/WooCommerce-Wear/build.gradle +++ b/WooCommerce-Wear/build.gradle @@ -219,3 +219,16 @@ static def loadPropertiesFromFile(inputFile) { } return properties } + +dependencyAnalysis { + issues { + onUnusedDependencies { + // This dependency is actually needed otherwise the app will crash with a runtime exception. + exclude(libs.androidx.hilt.navigation.compose.get().module.toString()) + // This dependency is actually needed otherwise the app will crash with a runtime exception. + exclude(libs.androidx.preference.ktx.get().module.toString()) + // This dependency is actually needed otherwise the app will crash with a runtime exception. + exclude(libs.androidx.work.runtime.ktx.get().module.toString()) + } + } +} From a71b6b7fe7480f1c86a8514b7e12a26150075934 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Irfan=20=C3=96m=C3=BCr?= Date: Wed, 12 Nov 2025 03:13:34 +0300 Subject: [PATCH 5/8] Exclude Unused Dependencies from Dependency Analysis for apifaker Exclude `androidx.compose.material.icons.extended` and `androidx.hilt.navigation.compose` from the dependency analysis for the `apifaker` library. --- libs/apifaker/build.gradle | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/libs/apifaker/build.gradle b/libs/apifaker/build.gradle index 2574adf9611..b627652d97e 100644 --- a/libs/apifaker/build.gradle +++ b/libs/apifaker/build.gradle @@ -56,3 +56,14 @@ dependencies { testImplementation(libs.mockito.kotlin) testImplementation(libs.kotlinx.coroutines.test) } + +dependencyAnalysis { + issues { + onUnusedDependencies { + // This dependency is actually needed otherwise the app will crash with a runtime exception. + exclude(libs.androidx.compose.material.icons.extended.get().module.toString()) + // This dependency is actually needed otherwise the app will crash with a runtime exception. + exclude(libs.androidx.hilt.navigation.compose.get().module.toString()) + } + } +} From 93876ec2cc886325de2dc2a4b383d9b597b9c745 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Irfan=20=C3=96m=C3=BCr?= Date: Wed, 12 Nov 2025 12:05:47 +0300 Subject: [PATCH 6/8] Exclude androidx.core.ktx from dependency analysis for fluxc-plugin This dependency is required for the app to build successfully, so it's being excluded from the unused dependency check to prevent build failures. --- libs/fluxc-plugin/build.gradle | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libs/fluxc-plugin/build.gradle b/libs/fluxc-plugin/build.gradle index 76d76472b76..03910d5007e 100644 --- a/libs/fluxc-plugin/build.gradle +++ b/libs/fluxc-plugin/build.gradle @@ -103,3 +103,12 @@ dependencies { androidTestImplementation libs.androidx.test.ext.junit androidTestImplementation libs.assertj.core } + +dependencyAnalysis { + issues { + onUnusedDependencies { + // This dependency is actually needed otherwise it will cause the app to fail to build. + exclude(libs.androidx.core.ktx.get().module.toString()) + } + } +} From cccd4ed961953d370bbbdb2cf0560f95c6e29f98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Irfan=20=C3=96m=C3=BCr?= Date: Wed, 12 Nov 2025 12:20:48 +0300 Subject: [PATCH 7/8] Exclude androidx.paging.runtime from unused dependency check Adds a `dependencyAnalysis` rule to `fluxc-tests` to exclude `androidx.paging.runtime`. --- libs/fluxc-tests/build.gradle | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libs/fluxc-tests/build.gradle b/libs/fluxc-tests/build.gradle index 9242c03b894..e548de79f48 100644 --- a/libs/fluxc-tests/build.gradle +++ b/libs/fluxc-tests/build.gradle @@ -50,3 +50,12 @@ dependencies { testImplementation libs.androidx.arch.core.testing testImplementation libs.androidx.paging.runtime } + +dependencyAnalysis { + issues { + onUnusedDependencies { + // This dependency is actually needed; otherwise, tests fail. + exclude(libs.androidx.paging.runtime.get().module.toString()) + } + } +} From 9a3ce416b31d789ef40562dd301974dc42dcaf59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Irfan=20=C3=96m=C3=BCr?= Date: Wed, 12 Nov 2025 13:29:18 +0300 Subject: [PATCH 8/8] Exclude okhttp3-tls from dependency analysis This dependency is required to prevent a `NoClassDefFoundError` during the card reader connection flow. --- libs/fluxc/build.gradle | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libs/fluxc/build.gradle b/libs/fluxc/build.gradle index ea7593498ef..605516da4a5 100644 --- a/libs/fluxc/build.gradle +++ b/libs/fluxc/build.gradle @@ -123,10 +123,12 @@ tasks.withType(KotlinCompile).configureEach { dependencyAnalysis { issues { onUnusedDependencies { - // This dependency is actually needed otherwise the app will crash with a runtime exception. + // This dependency is actually needed; otherwise, the app will crash with a runtime exception. exclude(libs.eventbus.android.get().module.toString()) - // This dependency is actually needed otherwise UI tests will crash with a runtime exception. + // This dependency is actually needed; otherwise, UI tests will crash with a runtime exception. exclude(libs.apache.http.client.android.get().module.toString()) + // This dependency is actually needed; otherwise, NoClassDefFoundError will be thrown during card reader connection flow. + exclude(libs.squareup.okhttp3.tls.get().module.toString()) } } }