tony
10/23/2025, 6:23 PMtony
10/23/2025, 6:24 PMruntimeOnly dependencies that would otherwise be removed if you followed advice to remove another dependency that had been transitively providing it. It considers dependencies to have "runtime-only capabilities" if they use some well-known java or android features like service providers or content providers (etc), or if they contain classes that are accessed via reflection (Class.forName("...")) by something else on the compile classpath.
I think this is an improvement, but note that upgrades to 3.3.0 might generate new advice when you thought you had already fully satisfied all of DAGP's requirements 😅
For some context, I originally started working on this feature after observing deployment failures for Cash backend services, since the JVM relies heavily on these runtime techniques—often implicitly (meaning without documentation). Those Cash services compiled fine but failed at runtime in various ways.Colton Idle
10/23/2025, 9:49 PMtony
10/23/2025, 9:50 PMreason task. Paste the output of the suggestion you're seeing here, pleasetony
10/23/2025, 9:54 PMColton Idle
10/23/2025, 9:56 PM./gradlew mysdk:reason --id org.jetbrains.kotlinx:kotlinx-coroutines-android
Configuration on demand is an incubating feature.
> Configure project :
> Task :mysdk:reason
------------------------------------------------------------
You asked about the dependency 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2 (libs.kotlinx.coroutines.android)'.
You have been advised to change this dependency to 'runtimeOnly' from 'implementation'.
------------------------------------------------------------
Shortest path from :mysdk to org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2 (libs.kotlinx.coroutines.android) for debugCompileClasspath:
:mysdk
\--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2
Shortest path from :mysdk to org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2 (libs.kotlinx.coroutines.android) for debugRuntimeClasspath:
:mysdk
\--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2
Shortest path from :mysdk to org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2 (libs.kotlinx.coroutines.android) for debugUnitTestCompileClasspath:
:mysdk
\--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2
Shortest path from :mysdk to org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2 (libs.kotlinx.coroutines.android) for debugUnitTestRuntimeClasspath:
:mysdk
\--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2
Shortest path from :mysdk to org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2 (libs.kotlinx.coroutines.android) for debugAndroidTestCompileClasspath:
:mysdk
\--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2
Shortest path from :mysdk to org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2 (libs.kotlinx.coroutines.android) for debugAndroidTestRuntimeClasspath:
:mysdk
\--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2
Shortest path from :mysdk to org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2 (libs.kotlinx.coroutines.android) for releaseCompileClasspath:
:mysdk
\--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2
Shortest path from :mysdk to org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2 (libs.kotlinx.coroutines.android) for releaseRuntimeClasspath:
:mysdk
\--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2
Shortest path from :mysdk to org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2 (libs.kotlinx.coroutines.android) for releaseUnitTestCompileClasspath:
:mysdk
\--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2
Shortest path from :mysdk to org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2 (libs.kotlinx.coroutines.android) for releaseUnitTestRuntimeClasspath:
:mysdk
\--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2
Source: debug, android_test
---------------------------
* Provides 2 service loaders: kotlinx.coroutines.android.AndroidDispatcherFactory, kotlinx.coroutines.android.AndroidExceptionPreHandler (implies testRuntimeOnly).
Source: debug, main
-------------------
* Provides 2 service loaders: kotlinx.coroutines.android.AndroidDispatcherFactory, kotlinx.coroutines.android.AndroidExceptionPreHandler (implies runtimeOnly).
Source: debug, test
-------------------
* Provides 2 service loaders: kotlinx.coroutines.android.AndroidDispatcherFactory, kotlinx.coroutines.android.AndroidExceptionPreHandler (implies testRuntimeOnly).
Source: release, main
---------------------
* Provides 2 service loaders: kotlinx.coroutines.android.AndroidDispatcherFactory, kotlinx.coroutines.android.AndroidExceptionPreHandler (implies runtimeOnly).
Source: release, test
---------------------
* Provides 2 service loaders: kotlinx.coroutines.android.AndroidDispatcherFactory, kotlinx.coroutines.android.AndroidExceptionPreHandler (implies testRuntimeOnly).
BUILD SUCCESSFUL in 821ms
183 actionable tasks: 1 executed, 182 up-to-datetony
10/23/2025, 9:57 PM* Provides 2 service loaders: kotlinx.coroutines.android.AndroidDispatcherFactory, kotlinx.coroutines.android.AndroidExceptionPreHandler (implies runtimeOnly).tony
10/23/2025, 9:58 PMtony
10/23/2025, 9:59 PMYou have been advised to change this dependency to 'runtimeOnly' from 'implementation'.
Basically you don't need it on implementation because you don't have to compile against it. But because it has these service loaders, DAGP can't safely recommend you fully remove it, as there might be some runtime accessColton Idle
10/23/2025, 10:00 PMtony
10/23/2025, 10:01 PMbuildHealth probably says you can either remove it or move it to runtimeOnly 👍