From 89522161dcc6bda810525fa45cfeb1688228cf43 Mon Sep 17 00:00:00 2001 From: David Allison <62114487+david-allison@users.noreply.github.com> Date: Sat, 25 Apr 2026 12:35:31 +0100 Subject: [PATCH] fix: ACRA crash reporting Cause: 0da67f45639246846875b5dc53d0a44415532c23 Moving to a `java-library` bundled a second copy of `org.json` which uses an incompatible `JSONWriter`. On a release build, R8 inlining causes a crash. `compileOnly` ensures the JAR is not copied over, and the Android `org.json` implementation is used Fixes 20852 Assisted-by: Claude Opus 4.7 - explaining the bug --- common/build.gradle.kts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common/build.gradle.kts b/common/build.gradle.kts index 13eae8fc688a..9f7475e7a8ee 100644 --- a/common/build.gradle.kts +++ b/common/build.gradle.kts @@ -17,7 +17,10 @@ kotlin { } dependencies { - implementation(libs.json) + // #20852: JSON must be compile-time only: Bundling `org.json:json` into the APK ships a second + // copy with a different field schema (vs the system version in `android.jar`) + compileOnly(libs.json) + testImplementation(libs.json) implementation(libs.androidx.annotation) implementation(libs.slf4j.api)