diff --git a/WooCommerce-Wear/build.gradle b/WooCommerce-Wear/build.gradle index 6c2253995291..40264d10bae2 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()) + } + } +} diff --git a/WooCommerce/build.gradle b/WooCommerce/build.gradle index 81fe10808c65..dd61d18f7af0 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' diff --git a/libs/apifaker/build.gradle b/libs/apifaker/build.gradle index 2574adf96113..b627652d97e1 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()) + } + } +} diff --git a/libs/fluxc-plugin/build.gradle b/libs/fluxc-plugin/build.gradle index 76d76472b769..03910d5007e7 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()) + } + } +} diff --git a/libs/fluxc-tests/build.gradle b/libs/fluxc-tests/build.gradle index 9242c03b8948..e548de79f48d 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()) + } + } +} diff --git a/libs/fluxc/build.gradle b/libs/fluxc/build.gradle index ea7593498ef7..605516da4a55 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()) } } }