diff --git a/CHANGELOG.md b/CHANGELOG.md index b890c67427..dc04f50b02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +### Unreleased + +### Fixes + +- Replay JNI usage with `SentryFlutterPlugin` ([#3036](https://github.com/getsentry/sentry-dart/pull/3036)) + ## 9.3.0 ### Breaking Change (Tooling) diff --git a/flutter/android/proguard-rules.pro b/flutter/android/proguard-rules.pro index d64759b4c6..b2adbf85f3 100644 --- a/flutter/android/proguard-rules.pro +++ b/flutter/android/proguard-rules.pro @@ -1,5 +1,12 @@ -keep class io.sentry.flutter.** { *; } +# Keep replay integration classes used by JNI +-keep class io.sentry.android.replay.** { *; } + +# Keep bitmap classes used by JNI +-keep class android.graphics.Bitmap { *; } +-keep class android.graphics.Bitmap$Config { *; } + # To ensure that stack traces is unambiguous # https://developer.android.com/studio/build/shrink-code#decode-stack-trace -keepattributes LineNumberTable,SourceFile diff --git a/flutter/lib/src/native/java/android_replay_recorder.dart b/flutter/lib/src/native/java/android_replay_recorder.dart index b85ee9a00e..4a9253e83c 100644 --- a/flutter/lib/src/native/java/android_replay_recorder.dart +++ b/flutter/lib/src/native/java/android_replay_recorder.dart @@ -140,7 +140,7 @@ class _AndroidNativeReplayWorker { // Android Bitmap creation is a bit costly so we reuse it between captures. native.Bitmap? bitmap; - final _nativeReplay = native.SentryFlutterPlugin$Companion(null) + final _nativeReplay = native.SentryFlutterPlugin.Companion .privateSentryGetReplayIntegration()!; receivePort.listen((message) {