Repository navigation
Conversation
The Java frames parsed from a Dart-captured PlatformException stayed minified: the Android SDK only attaches the proguard debug image to the events it captures itself, so Sentry could not find the R8 mapping and every build split the defect into a new issue. - Expose the native SDK's ProGuard UUID on SentryNativeBinding, read once through JNI on first use and cached, so it also works when autoInitializeNativeSdk is disabled - AndroidPlatformExceptionEventProcessor attaches a proguard debug image when it adds Java frames, keeping existing images and skipping duplicates - LoadNativeDebugImagesIntegration appends native images instead of replacing debug_meta, which dropped the proguard image on obfuscated or split-debug-info builds Fixes getsentry#4080 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit f647019. Configure here.
The UUID was cached on first read, null included. With autoInitializeNativeSdk disabled, a PlatformException processed before the native SDK resolved the UUID left Java frames minified for the rest of the process. Cache the UUID once found and retry null reads. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4081 +/- ##
==========================================
+ Coverage 88.77% 92.90% +4.13%
==========================================
Files 348 114 -234
Lines 12577 4596 -7981
==========================================
- Hits 11165 4270 -6895
+ Misses 1412 326 -1086
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
|
Thanks for the approval @buenaflor! 🙏 The merge is currently blocked because the CI hasn't run on the latest commit: since the branch comes from a fork, the workflows are waiting for maintainer approval. Sorry about the extra "Update branch" merges on my side, each one reset that approval, so I'll leave the branch as is from now on. A couple of questions so I know what to expect:
|
|
I'll take care of merging. It will land in release |

📜 Description
Attach the ProGuard debug image to Dart-captured
PlatformExceptionevents on Android, so their Java frames get deobfuscated.SentryNativeBinding.proguardUuid: new internal getter.SentryNativeJavareadsScopesAdapter.instance.options.proguardUuidthrough JNI and releases both references infinallyFn. The other bindings returnnull.init(), becauseinit()is skipped whenautoInitializeNativeSdkis disabled. It is cached once found, and anullread is retried on the nextPlatformException, since the native SDK may not have resolved it yet (fromSentryFlutterOptions.proguardUuidor thesentry-debug-meta.propertiesasset). The retry only costs a JNI field read on non-minified builds, where no UUID is ever found.AndroidPlatformExceptionEventProcessor: once it adds Java frames, it addsDebugImage(type: 'proguard', uuid: …)todebugMeta. Existing images are kept, and no image is added if a proguard image with the same UUID is already there. Nothing changes when no UUID is available.LoadNativeDebugImagesIntegration: appends the native images todebugMetainstead of replacing it. That processor runs after the Android one, so on obfuscated or--split-debug-infobuilds it would otherwise drop the proguard image.💡 Motivation and Context
Fixes #4080. Discussed in #4067.
AndroidPlatformExceptionEventProcessorparses the Java stack trace intojavaframes, but the event has noproguardimage. The Android SDK only adds that image to the events it captures itself; a Dart-built event is sent as-is throughcaptureEnvelope. As a result the frames stay minified (h5.q.<init>), and since minified names change between builds, each release splits the same defect into a new issue. Related: #2841.As suggested in #4067, the fix is on the Dart side and needs no native code change: the getter already exists in the generated JNI bindings.
💚 How did you test it?
AndroidPlatformExceptionEventProcessor: adds the proguard image, keeps existing images, no duplicate, nothing without Java frames, nothing without a UUID.LoadNativeDebugImagesIntegration: keeps existing debug images.flutter testonpackages/flutter: all passing.dart formatanddart analyze --fatal-infosare clean with the stable Flutter-bundled Dart (3.13.4).options.proguardUuidand checks both the native options andSentryFlutter.native?.proguardUuid.integration_test/all.dartpasses on a physical device (Samsung SM-X216B).dependency_overrides. The app's own workaround processor was disabled, so the image could only come from the SDK.releasebuild with the Sentry Android Gradle Plugin, which embeddedb0d5c2ce-495c-390d-a0c9-a5280a07329cand uploaded the mapping under it.PlatformException(TextInputChannelrejectingsetEditingState,IndexOutOfBoundsException: invalid selection start).debug_meta: [{type: proguard, uuid: b0d5c2ce-…}]and no processing errors.io.flutter.embedding.engine.systemchannels.TextInputChannel$TextEditState.<init> (TextInputChannel.java:820)instead ofh5.q.<init>.📝 Checklist
sendDefaultPiiis enabledNo public API change:
SentryNativeBindingis@internal.🔮 Next steps
None.
Changelog Entry
Deobfuscate the Java frames of Dart-captured
PlatformExceptionevents on Android by attaching the ProGuard debug image, and keep existing debug images when loading native ones.