Fix: Add ProGuard rules for jsoup's optional RE2J dependency to fix release build #22521
Fix: Add ProGuard rules for jsoup's optional RE2J dependency to fix release build #22521crazytonyli merged 1 commit intorelease/26.5from
Conversation
Generated by 🚫 Danger |
|
|
| App Name | Jetpack | |
| Flavor | Jalapeno | |
| Build Type | Debug | |
| Version | pr22521-0732803 | |
| Commit | 0732803 | |
| Direct Download | jetpack-prototype-build-pr22521-0732803.apk |
|
| App Name | WordPress | |
| Flavor | Jalapeno | |
| Build Type | Debug | |
| Version | pr22521-0732803 | |
| Commit | 0732803 | |
| Direct Download | wordpress-prototype-build-pr22521-0732803.apk |
|
Claude finished @adalpari's task in 1m 21s —— View job Code ReviewProgress
SummaryThe PR correctly addresses the R8 build failure by adding ✅ Strengths
📋 Observations
✅ ApprovalThis is a straightforward, correct fix for the build failure. The change:
Recommendation: Approve and merge. |
* Bump version number * Update draft release notes for 26.5 * Update draft release notes for Jetpack 26.5. * Release Notes: add new section for next version (26.6) * Add release notes These are compiled based on git commits * Merge strings from libraries for translation * Freeze strings for translation * Adding an ignore rule to the optional classes check (#22521) --------- Co-authored-by: Tony Li <tony.li@automattic.com> Co-authored-by: Adalberto Plaza <adalpari@gmail.com>





Description
See the build issue: https://buildkite.com/automattic/wordpress-android/builds/24599
Fixes the beta release build failure caused by R8 detecting missing
com.google.re2jclasses referenced by jsoup's optional RE2Jregex support.
jsoup 1.22.1 added optional support for Google's RE2J regex engine for CSS selectors. Since RE2J is not included as a dependency in
this project, R8 fails the release build when it encounters references to the missing classes.
The fix adds
-dontwarnrules toproguard.cfgto suppress these warnings, which is the standard approach for optional dependencies.Why this won't break the app
RE2J is an optional dependency in jsoup. The library is designed to:
The
-dontwarnrules only tell R8 not to fail the build when it sees references to classes that might not exist at runtime. Theydon't change any runtime behavior.
At runtime, jsoup checks if
com.google.re2jclasses are available. Since they're not included in the app, jsoup automatically usesJava's standard
java.util.regexengine instead - which is what the app was using before jsoup added RE2J support.