packages.flutter icon indicating copy to clipboard operation
packages.flutter copied to clipboard

Android due to missing or outdated method onSurfaceDestroyed()

Open MrKhay opened this issue 6 months ago • 2 comments

Describe the bug

The plugin fails to compile on Android due to missing or outdated method implementations in Messages.kt. The SurfaceProducer.Callback interface requires onSurfaceDestroyed() to be implemented, but the current version (pdfx-2.9.1) does not include it. Additionally, onSurfaceCleanup() is used but no longer exists in the latest Flutter Android embedding.

To Reproduce

  • Steps to reproduce the behavior:
  • Add pdfx: ^2.9.1 to pubspec.yaml
  • Run flutter pub get
  • Launch the app on Android (e.g., flutter run)

Smartphone: Device: Samsung Galaxy S23 Ultra OS: Android 14 Version: Flutter 3.22.0, Dart 3.2.x

Additional context

e: Messages.kt:256:37 Object is not abstract and does not implement abstract member public abstract fun onSurfaceDestroyed(): Unit defined in io.flutter.view.TextureRegistry.SurfaceProducer.Callback
e: Messages.kt:267:13 'onSurfaceCleanup' overrides nothing

MrKhay avatar Jun 12 '25 09:06 MrKhay

@MrKhay, use pdfx: 2.8.0 as a temporary workaround for now.

dharambudh1 avatar Jun 13 '25 04:06 dharambudh1

one can as well upgrade flutter to 3.29+

emakar avatar Jun 13 '25 21:06 emakar