Skip to content

feat(gradle-plugin): upload native debug symbols via symbol-sets upload - #660

Draft
cat-ph wants to merge 1 commit into
mainfrom
cat/gradle-native-symbol-upload
Draft

feat(gradle-plugin): upload native debug symbols via symbol-sets upload#660
cat-ph wants to merge 1 commit into
mainfrom
cat/gradle-native-symbol-upload

Conversation

@cat-ph

@cat-ph cat-ph commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

💡 Motivation and Context

Native crash capture (#659) needs the app's .so debug symbols uploaded at build time, the same way the plugin already uploads ProGuard mappings. This registers an uploadPostHogNativeSymbols<Variant> task that points posthog-cli symbol-sets upload (>= 0.7.32) at the variant's merged native libs intermediates: the unstripped libraries as built, before AGP strips them for packaging. The CLI scans the directory, uploads every library carrying debug info and a GNU build id, and triages the rest with guidance.

Wiring choices:

  • Registered for every variant, independent of minification: native symbolication is orthogonal to JVM obfuscation, so the task also exists (and auto-runs) for non-minified builds.
  • Auto-hooked to assemble/install/bundle only when the app module builds native code itself (externalNativeBuild configured). Apps that only bundle prebuilt .so files from dependencies can run the task explicitly; auto-uploading for every app with any bundled .so (e.g. every React Native app) felt too surprising for a first release.
  • Skipped via onlyIf when the variant has no .so files at all.
  • Reuses the existing CLI discovery, credential, and dotenv plumbing (PostHogCliExecTask), so tasks.withType<PostHogCliExecTask> configuration applies to it like the mapping upload.

💚 How did you test it?

  • ./gradlew -p posthog-android-gradle-plugin build green on a remote linux box (the plugin has no test suite today; the task follows the existing PostHogUploadProguardMappingsTask structure).
  • Not yet done (why this is a draft): exercising the task against a real NDK app build and verifying the upload lands, planned as part of the end-to-end validation for the SDK PR.

📝 Checklist

  • I reviewed the submitted code.
  • I added tests to verify the changes. (no test infrastructure exists in the plugin build; follows the existing upload task pattern)
  • I updated the docs if needed. (docs PR is staged separately, gated on release)
  • No breaking change or entry added to the changelog.

If releasing new changes

  • Ran pnpm changeset to generate a changeset file

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.

1 participant