Integration
sentry-android
Build System
Gradle
AGP Version
9.5.1
Proguard
Enabled
Other Error Monitoring Solution
No
Version
8.43.2
Steps to Reproduce
For sentry_samples_android app
- Declare native function in io/sentry/samples/android/NativeSample.java
public static native void captureException();
- Implement native function in native-sample.cpp
JNIEXPORT void JNICALL Java_io_sentry_samples_android_NativeSample_captureException(
JNIEnv *env, jclass cls) {
sentry_value_t event = sentry_value_new_event();
sentry_value_t exc = sentry_value_new_exception("Exception", "Error message.");
sentry_value_set_stacktrace(exc, NULL, 0);
sentry_event_add_exception(event, exc);
sentry_capture_event(event);
}
- Add button to trigger the method in io/sentry/samples/android/MainActivity.kt:
item {
SentryTraced("capture_exception_native") {
OutlinedButton(
onClick = {
NativeSample.captureException();
},
modifier = Modifier,
) {
Text("Capture Exception Native", maxLines = 2, overflow = TextOverflow.Ellipsis)
}
}
}
- Build and run app, click "Capture Exception Native"
- Check event's attachments
Expected Result
Attachments are not duplicated
Actual Result
Attachment duplication:

Integration
sentry-android
Build System
Gradle
AGP Version
9.5.1
Proguard
Enabled
Other Error Monitoring Solution
No
Version
8.43.2
Steps to Reproduce
For sentry_samples_android app
public static native void captureException();Expected Result
Attachments are not duplicated
Actual Result
Attachment duplication: