Skip to content

Fix compatibility issues on Android 10 and below: replace VarHandle with synchronized & avoid StringBuilder.isEmpty()#6

Draft
anonyein wants to merge 23 commits into
caoccao:mainfrom
anonyein:origin
Draft

Fix compatibility issues on Android 10 and below: replace VarHandle with synchronized & avoid StringBuilder.isEmpty()#6
anonyein wants to merge 23 commits into
caoccao:mainfrom
anonyein:origin

Conversation

@anonyein

@anonyein anonyein commented Apr 6, 2026

Copy link
Copy Markdown

This PR addresses two critical compatibility issues that prevent the library from running on Android 10 (API 29) and earlier versions:

VerifyError caused by VarHandle on Android 10 – Dalvik/ART bytecode verifier fails to handle signature‑polymorphic methods of VarHandle when operating on byte[], leading to java.lang.VerifyError.

NoSuchMethodError for StringBuilder.isEmpty() on older Android versions – StringBuilder.isEmpty() was added in API level 35 (Android 14). On devices running API < 34, the method is missing and causes runtime crashes.

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