Skip to content

fix: ACRA crash reporting#20856

Merged
lukstbit merged 1 commit intoankidroid:mainfrom
david-allison:acra-bug
Apr 25, 2026
Merged

fix: ACRA crash reporting#20856
lukstbit merged 1 commit intoankidroid:mainfrom
david-allison:acra-bug

Conversation

@david-allison
Copy link
Copy Markdown
Member

Note

Assisted-by: Claude Opus 4.7 - explaining the bug

Purpose / Description

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.

Fixes

Approach

compileOnly ensures the JAR is not copied over, and the Android org.json implementation is used

How Has This Been Tested?

The same command I used in my bisects

unset TEST_RELEASE_BUILD && ./gradlew :AnkiDroid:assemblePlayRelease && adb uninstall com.ichi2.anki ; adb install /Users/davidallison/StudioProjects/Anki-Android/AnkiDroid/build/outputs/apk/play/release/AnkiDroid-play-arm64-v8a-release.apk

  • Help - Get help - Send troubleshooting report

Learning

Checklist

  • You have a descriptive commit message with a short title (first line, max 50 chars).
  • You have commented your code, particularly in hard-to-understand areas
  • You have performed a self-review of your own code
  • UI changes: include screenshots of all affected screens (in particular showing any new or changed strings)
  • UI Changes: You have tested your change using the Google Accessibility Scanner

Cause: 0da67f4

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
Copy link
Copy Markdown
Member

@BrayanDSO BrayanDSO left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work

@BrayanDSO BrayanDSO added Needs Second Approval Has one approval, one more approval to merge and removed Needs Review labels Apr 25, 2026
@lukstbit lukstbit added Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) and removed Needs Second Approval Has one approval, one more approval to merge labels Apr 25, 2026
@lukstbit lukstbit added this pull request to the merge queue Apr 25, 2026
Merged via the queue into ankidroid:main with commit 19ae3b0 Apr 25, 2026
19 checks passed
@github-actions github-actions Bot removed Pending Merge Things with approval that are waiting future merge (e.g. targets a future release, CI wait, etc) Review High Priority Request for high priority review labels Apr 25, 2026
@github-actions github-actions Bot added this to the 2.24 release milestone Apr 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2.24.0beta1: ACRA is broken [JSONStringer: NoSuchFieldError]

3 participants