Skip to content

fix: Replace super_clipboard to resolve 16kb page memory crashes on Android#20

Open
abdulmominsakib wants to merge 1 commit into
serverpod:mainfrom
abdulmominsakib:main
Open

fix: Replace super_clipboard to resolve 16kb page memory crashes on Android#20
abdulmominsakib wants to merge 1 commit into
serverpod:mainfrom
abdulmominsakib:main

Conversation

@abdulmominsakib

Copy link
Copy Markdown

Context & Problem: Currently, this package relies on super_clipboard to provide syntax-highlighted (HTML) copying functionality. However, super_clipboard depends on super_native_extensions, which currently contains a critical bug: it does not support 16kb page memory sizes (super_native_extensions#560).

Because newer Android devices (like the Pixel 8 series on Android 15+) are transitioning to 16kb page sizes, applications importing this package are experiencing native crashes that are completely out of their control.

Solution: This PR swaps out super_clipboard for the clipboard package. Recent updates to the clipboard package introduced native support for Rich Text (HTML) copying, which means we no longer need the heavy native dependencies that super_clipboard brings.

Changes:

Removed super_clipboard from pubspec.yaml
Added clipboard: ^3.0.14 to pubspec.yaml
Refactored _CopyAction.invoke in code_editor.dart to use the cleaner FlutterClipboard.copyRichText API.

Impact:

  • Fixes crashes: Eliminates the 16kb page size restriction entirely.
  • Lighter footprint: Removes heavy transitive native dependencies (super_native_extensions, rust, C++ scaffolding).
  • Same functionality: Users can still copy code snippets with full syntax highlighting into rich-text editors (Word, Emails, IDEs).

@abdulmominsakib

Copy link
Copy Markdown
Author

@vlidholt can you take a look 👀

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.

1 participant