Skip to content

build: write native debug symbols for Play Console on release builds - #1686

Merged
HashEngineering merged 1 commit into
feat/kotlin-sdk-phase-1from
chore/native-debug-symbols
Dec 1, 2026
Merged

HashEngineering merged 1 commit into
feat/kotlin-sdk-phase-1from
chore/native-debug-symbols

Conversation

@HashEngineering

Copy link
Copy Markdown
Collaborator

What

wallet/build.gradle, release build type: ndk { debugSymbolLevel 'SYMBOL_TABLE' }.

Why

Release APKs ship with stripped native libraries, so native crashes and ANRs in Play Console (Android vitals) show no function names. With this setting AGP writes wallet/build/outputs/native-debug-symbols/<variant>/native-debug-symbols.zip from the libraries before they are stripped, and that zip can be uploaded to Play Console.

The Kotlin SDK libraries contain only a symbol table (.symtab, no DWARF), so stack traces get function names but not line numbers. FULL would add nothing over SYMBOL_TABLE.

Uploading

The Fastlane lane uploads an APK through supply, which sends the APK and mapping.txt only. Until the lane is extended, upload the zip by hand: Play Console → App bundle explorer → the version → Downloads → Native debug symbols. An app bundle would include it automatically.

Native crashes do not reach Crashlytics either way: the app uses firebase-crashlytics-ktx, not firebase-crashlytics-ndk.

Needs the pinned NDK

AGP extracts the symbols with the NDK named by android.ndkVersion. On a host without that NDK it writes no zip and only logs [CXX1101]. #1685 moves the pin to NDK 29.0.14206865.

Verification

With NDK 29.0.14206865, :wallet:mergeProdReleaseNativeDebugMetadata writes native-debug-symbols.zip (54.6 MB) containing arm64-v8a/libdash_sdk_jni.so.sym and x86_64/libdash_sdk_jni.so.sym. The other prebuilt libraries carry no symbols.

🤖 Generated with Claude Code

debugSymbolLevel SYMBOL_TABLE makes AGP write native-debug-symbols.zip
from the prebuilt libraries before they are stripped, so native crashes
in Android vitals show function names. The Kotlin SDK libraries carry
only a symbol table (no DWARF), so FULL would add nothing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 21 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 589e939 and e4cb069.

Files selected for processing: 1

  • wallet/build.gradle
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@thepastaclaw

thepastaclaw commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

✅ Final review complete — no blockers (commit e4cb069) · triage: low

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Final validation — Phase 1 + Phase 2

The exact head e4cb069 adds only release-scoped native symbol extraction, with no confirmed actionable defects. The existing APK upload lane remains compatible with generating the archive and uploading it manually; automation or an additional warning is not necessary for that workflow to function. Validation was static only; current build and check jobs pass, and the automated review check remains pending.

Review provenance

Source: reviewer 1: glm-5.3-flash (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.1-sol (agent: phase2-reviewer, role: general); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)

  • Triage: low by gpt-6.1-sol (effort low) — The change is a small, contained release-build configuration update that enables native symbol artifact generation and is straightforward to verify.
  • Phase 1 reviewers: glm-5.3-flash — general (completed, effort high); agent phase1-reviewer
  • Phase 1 model: glm-5.3-flash — zai quota: 5h 99% left, weekly 29% left; passed over gemini-3.8-flash-high (antigravity quota lookup failed)
  • Fresh verifier: gpt-6.1-sol — final-verifier; agent sol-verifier
  • Phase 2 reviewers: gpt-6.1-sol — general (completed, effort medium); agent phase2-reviewer

@HashEngineering

Copy link
Copy Markdown
Collaborator Author

Status note, ahead of a decision on this PR:

Play Console: the 12.0.2 app bundle (bundleProdRelease, built without this change) already carries the native debug symbols. BUNDLE-METADATA includes libdash_sdk_jni.so.sym for arm64-v8a and x86_64, and Play ingests them with the upload. For bundles, debugSymbolLevel 'SYMBOL_TABLE' adds nothing over what AGP packages today.

Firebase: this change doesn't help Firebase either.

  • App Distribution ships the apk to testers and never reads symbols.
  • native-debug-symbols.zip is in Play Console's format. Crashlytics doesn't read it.
  • The app depends on firebase-crashlytics-ktx (common/build.gradle), which only reports Java/Kotlin crashes. A crash inside libdash_sdk_jni.so isn't captured, so there is nothing to symbolicate.

Native crash reports in Crashlytics would need a separate change:

  1. Switch to firebase-crashlytics-ndk.
  2. Set nativeSymbolUploadEnabled true in the Crashlytics Gradle extension, with unstrippedNativeLibsDir pointing at the SDK's unstripped libraries.
  3. Run uploadCrashlyticsSymbolFile<Variant> after each build.

The SDK's .so files reach us without debug info but with symbol tables, so those reports would show function names but not file and line numbers.

Holding this PR open for now. It may close in favour of the Crashlytics NDK change.

🤖 Generated with Claude Code

@HashEngineering

Copy link
Copy Markdown
Collaborator Author

QA ✅ PASS — run 50, build 12000301 (12.0.3-qa01)

Verified from the build output rather than on a device, because this PR changes nothing a device can observe. Commit under test: e4cb069f.

What the build produced

wallet/build/outputs/native-debug-symbols/_testNet3Release/native-debug-symbols.zip — 59,020,505 B, carrying both ABIs:

file size
arm64-v8a/libdash_sdk_jni.so.sym 79,596,120 B
x86_64/libdash_sdk_jni.so.sym 84,907,984 B

Reading the arm64 one with readelf:

  • .symtab and .strtab are present, with 58,807 FUNC symbols. That is the symbol table Play Console needs to turn a native crash in Android vitals into function names.
  • There is no .debug_info, which confirms the PR description's own reasoning from the artifact: the SDK libraries carry no DWARF, so FULL would have added nothing over SYMBOL_TABLE.
  • The library actually shipped inside the APK is stripped — zero SYMTAB sections. So this gets the symbols to Play Console without growing the APK, which is the point.

One thing it does not fix

Neither file carries a .note.gnu.build-id; the only note section in either is .note.android.ident. That is the other half of D-42S7-01 (run 42: "the JNI library carries no BuildID, and its symbol table is now stripped"). This PR closes the symbol-table half cleanly. The build-id half lives in the SDK's own native build and is untouched here — worth a separate issue upstream rather than scope creep on this one.

Build provenance

Build: qa/integration-12.0.3 @ 883e49e4 = feat/kotlin-sdk-phase-1 @ 83a56f72 — the v12.0.2 tag, the commit that shipped to Google Play — plus ten PRs merged in this order: #1686 #1712 #1719 #1548 #1694 #1697 #1713 #1721 #1717 #1718. All ten merged clean. No branch was rebased or updated, by request, so this is each PR as its author left it. The order was settled by trial-merging rather than by GitHub's mergeable flag.

The SDK pin does not move — int36, the same pin 12.0.2 shipped with, and checked rather than assumed: libdash_sdk_jni.so was unpacked from this APK and from the shipped 12.0.2 and compared byte for byte (60,350,088 B, sha256 950faef8a1a6fe2d…, identical). Everything reported above is therefore an app change, not an engine one.

APK: versionCode 12000301, 328,718,680 B, sha256 f5684c4e4ec8f80a5642d2cb2074e17970d1156f7af6034b3b3409e87c2a8ce7, project release key. _testNet3 only — no mainnet or prod arm was built, by request.

Run: QA run 50, testnet, 2026-11-19. Five Android 16 devices plus one at API 29. Unit tests on the merged tree: 5,007 passing, 0 failures.

@HashEngineering

Copy link
Copy Markdown
Collaborator Author

QA run 52 — correction to what I told you in run 50: on int42 this PR now produces nothing

In run 50 I reported that debugSymbolLevel SYMBOL_TABLE worked, and showed the symbol counts to prove it. That was true on int36. It is not true on the SDK this build uses, and I should correct it rather than leave the earlier comment standing.

On builds 12000303 and 12000304 (Kotlin SDK int42, dashj-platform 5.1.0-dev.3):

merge_testNet3ReleaseNativeDebugMetadata  → NO-SOURCE

The task has nothing to do because both native libraries now arrive pre-stripped. In merged_native_libs, libdash_sdk_jni.so and libsdklib.so have 0 SYMTAB entries on both arm64-v8a and x86_64. For comparison, the int36 build this PR was verified against carried a symbol table with 58,807 FUNC entries (arm64) and 58,989 (x86_64).

This is not a fault in this PR. The PR still does exactly what it says; there is simply no symbol table left for it to package. The change is upstream, in how the SDK artifacts are built. The consequence is worth stating plainly: Play Console receives no native-crash symbols for this SDK, so a crash inside the JNI or dpp layers cannot be symbolicated from a release build — which is the wall D-41S4-01 hit on a real mainnet abort.

Nothing to do here unless you want to chase it upstream; filed as context so the earlier comment is not read as still current.

How this was tested

Builds. 12000303 = feat/kotlin-sdk-phase-1 @ 83a56f723 (the v12.0.2 tag) + Kotlin SDK int42 + dashj-platform 5.1.0-dev.3-20261123.212721-1, with #1686, #1712, #1719, #1548, #1694, #1697, #1713, #1721, #1717, #1718 and #1730 merged at their then-current heads.
12000304 = the same, plus #1736, and with #1725/#1721/#1718/#1714 taken from qa/spv-restart-with-1721-1718 @ 9244f3324 instead of merged separately. APK sha256 96422c3acd8dab7939ab12402d407a5500326f454564aae5b877e6c9e7e2c253.

Devices. Android 16 (API 36) emulators, testnet, release-signed builds. Platform protocol 14.

Unit tests on 12000304: 4,779 tests across 330 classes, 0 failures, 0 errors, 1 skipped.

Both SDK native libraries are byte-identical in size across the two builds, so differences between them come from the PRs and not from the SDK underneath.

Full report: https://github.com/HashEngineering/dash-wallet-qa-report — run 52.

@HashEngineering

Copy link
Copy Markdown
Collaborator Author

QA run 56 — the configuration is right; it produces nothing on this build

Merged cleanly (e4cb069f6, +7/-0 in one file) and the ndk { debugSymbolLevel 'SYMBOL_TABLE' } block is present and correctly placed in the release build type.

But no symbols come out of it:

> Task :wallet:merge_testNet3ReleaseNativeDebugMetadata NO-SOURCE

and no native-debug-symbols.zip exists anywhere under wallet/build/outputs after a full assemble_testNet3Release.

This isn't new, and it isn't the PR's fault

Run 52 recorded exactly the same NO-SOURCE result, and also recorded that run 50 produced a 59,020,505-byte native-debug-symbols.zip from the same task with the same configuration. So the task worked when the prebuilt SDK libraries still carried something to merge, and has produced nothing since.

Your own comment in the diff anticipates part of this — "The SDK libraries carry no DWARF, so FULL would add nothing over SYMBOL_TABLE" — but with the current libraries even SYMBOL_TABLE has nothing to collect.

What that means practically

Native crashes in Play Console's Android vitals will still arrive unsymbolicated, so the PR's stated benefit isn't being realised on builds from this line. Whether that's worth chasing depends on whether the SDK can ship libraries with symbol tables intact — which is an SDK-side question, not one this PR can answer.

Nothing here argues against merging: the configuration is correct and costs nothing.


QA run 56, 2026-11-30. Build 12000305 (12.0.3-qa05), branch qa/integration-12.0.3-qa05
off feat/kotlin-sdk-phase-1 @ 19ec4858dd — twelve PRs in ten merges, no conflicts.
Pins: Kotlin SDK 5.1.0-int43-20261126.183836-1, dashj-platform 5.1.0, dashj 24.0.0 — the
same pairing the shipped 12.0.3 builds use. APK sha256
76d464966bcad134c9e5360d8524ae5fb2850b46f6d9e23f83f9d0d08d56a2c3.
Unit tests 4,841 / 330 classes, 2 failures, both reproduced on the bare base.
Devices: Android 16 emulators, testnet at Platform protocol 15.

HashEngineering added a commit that referenced this pull request Dec 1, 2026
@HashEngineering
HashEngineering merged commit 2a282e7 into feat/kotlin-sdk-phase-1 Dec 1, 2026
4 checks passed
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 participants