Colton Idle
10/08/2025, 8:44 PM./gradlew androidlibrary:assemble is successful, but ./gradlew app:assemble fails due to
* What went wrong:
Execution failed for task ':app:checkDebugDuplicateClasses'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
> Duplicate class okhttp3.Address found in modules okhttp-jvm-5.1.0.jar -> okhttp-jvm-5.1.0 (com.squareup.okhttp3:okhttp-jvm:5.1.0) and okhttp-release.aar -> okhttp-release-runtime (com.squareup.okhttp3:okhttp-android:5.1.0)
seems like something regarding okhttp-jvm and okhttp-android? according to docs, this shouldn't be an issue since im using gradle and not maven?Colton Idle
10/08/2025, 8:51 PMimplementation to api would do the trick, but no go. im still a library noob so maybe im making some beginner mistake here.
AI is going wild and writing gradle tasks to rewrite all of okhttp-jvm to okhttp-android.ephemient
10/08/2025, 9:06 PM./gradlew :app:dependencyInsight --configuration debugRuntimeClasspath --dependency com.squareup.okhttp3:okhttp-jvmColton Idle
10/08/2025, 9:11 PMColton Idle
10/08/2025, 9:18 PMColton Idle
10/08/2025, 9:23 PMconfigurations.all {
resolutionStrategy {
eachDependency {
if (requested.group == "com.squareup.okhttp3" && requested.name == "okhttp-jvm") {
useTarget("com.squareup.okhttp3:okhttp:${requested.version}")
because("choosing okhttp over okhttp-jvm")
}
}
}
}
so maybe i should also dump that into my app
https://github.com/open-telemetry/opentelemetry-android/blob/1f6c876e04c368f22294c0756ea00cf36bf42ef5/demo-app/build.gradle.kts#L101ephemient
10/08/2025, 9:27 PMOTel Java switched to explicitly defining okhttp-jvm as their dependency for OkHttp (which I think makes sense, given that they are focused primarily on plain Java projects), and since OTel Android depends on OTel Java as its base, it means that we get okhttp-jvm as a transitive dependency
Colton Idle
10/09/2025, 12:57 AMconfigurations.all {
resolutionStrategy {
eachDependency {
...
themselves in the app module OR if this is something I can do in the library so that app devs don't have to think about it.Colton Idle
10/09/2025, 5:43 AMephemient
10/09/2025, 2:37 PMephemient
10/09/2025, 2:40 PMColton Idle
10/09/2025, 4:31 PMephemient
10/09/2025, 4:50 PMColton Idle
10/09/2025, 5:12 PMephemient
10/09/2025, 5:14 PMColton Idle
10/09/2025, 5:15 PM