Skip to content

Conversation

@bitsandfoxes
Copy link
Contributor

📜 Description

Add support for setting the native SDK name via AndroidManifest metadata.

This adds a new manifest key io.sentry.ndk.sdk-name that allows hybrid SDKs (like Unity) to configure the native SDK name for NDK crashes during build-time initialization.

💡 Motivation and Context

When using the Sentry Unity SDK on Android, native C/C++ crashes captured by sentry-native are reported with SDK name sentry.native.android instead of sentry.native.android.unity.

This happens because:

  1. The prebuilt sentry-native-ndk AAR is compiled with the default SDK name
  2. There was no way to override the native SDK name via AndroidManifest for build-time initialization
  3. The existing io.sentry.sdk.name only sets the Java SDK name, not the native SDK name

The nativeSdkName can be set at runtime via SentryAndroidOptions.setNativeSdkName(), but for build-time initialization via manifest, there was no corresponding key.

💚 How did you test it?

  • Added unit tests for ManifestMetadataReader:
    • applyMetadata reads nativeSdkName to options - verifies the value is read from manifest
    • applyMetadata reads nativeSdkName and keeps default - verifies null default is preserved

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

  • Update Unity SDK to set io.sentry.ndk.sdk-name=sentry.native.android.unity in AndroidManifest during build

@github-actions
Copy link
Contributor

github-actions bot commented Jan 14, 2026

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 765c76e

@bitsandfoxes bitsandfoxes changed the title feat: Native SDK name in Manifest feat: Allow setting native SDK name in manifest Jan 14, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Jan 14, 2026

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 335.37 ms 395.47 ms 60.10 ms
Size 1.58 MiB 2.20 MiB 635.34 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
f634d01 375.06 ms 420.04 ms 44.98 ms
d5a29b6 298.62 ms 391.78 ms 93.16 ms
fcec2f2 314.96 ms 373.66 ms 58.70 ms
bbc35bb 324.88 ms 425.73 ms 100.85 ms
ee747ae 405.43 ms 485.70 ms 80.28 ms
d15471f 369.38 ms 459.08 ms 89.70 ms
ee747ae 396.82 ms 441.67 ms 44.86 ms
fc5ccaf 276.52 ms 370.46 ms 93.93 ms
bbc35bb 298.53 ms 372.17 ms 73.64 ms
d15471f 310.66 ms 368.19 ms 57.53 ms

App size

Revision Plain With Sentry Diff
f634d01 1.58 MiB 2.10 MiB 533.40 KiB
d5a29b6 1.58 MiB 2.12 MiB 549.37 KiB
fcec2f2 1.58 MiB 2.12 MiB 551.50 KiB
bbc35bb 1.58 MiB 2.12 MiB 553.01 KiB
ee747ae 1.58 MiB 2.10 MiB 530.95 KiB
d15471f 1.58 MiB 2.13 MiB 559.54 KiB
ee747ae 1.58 MiB 2.10 MiB 530.95 KiB
fc5ccaf 1.58 MiB 2.13 MiB 557.54 KiB
bbc35bb 1.58 MiB 2.12 MiB 553.01 KiB
d15471f 1.58 MiB 2.13 MiB 559.54 KiB

Previous results on branch: feat/native-sdk-name-manifest

Startup times

Revision Plain With Sentry Diff
6ea83e7 363.80 ms 430.24 ms 66.44 ms
1e749b4 326.17 ms 409.79 ms 83.62 ms
bf3d32c 329.42 ms 391.49 ms 62.07 ms

App size

Revision Plain With Sentry Diff
6ea83e7 1.58 MiB 2.20 MiB 635.34 KiB
1e749b4 1.58 MiB 2.20 MiB 633.77 KiB
bf3d32c 1.58 MiB 2.20 MiB 635.34 KiB

@markushi markushi merged commit 1edbdfa into main Jan 15, 2026
61 checks passed
@markushi markushi deleted the feat/native-sdk-name-manifest branch January 15, 2026 15:24
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.

3 participants