Skip to content

ADFA-5500: Keep the app libraries the layout editor plugin still loses to R8 - #2094

Open
Daniel-ADFA wants to merge 1 commit into
stagefrom
bugfix/ADFA-5500-plugin-layout-inflation
Open

Daniel-ADFA wants to merge 1 commit into
stagefrom
bugfix/ADFA-5500-plugin-layout-inflation

Conversation

@Daniel-ADFA

@Daniel-ADFA Daniel-ADFA commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

ADFA-5500

The GlitchTip NPE is a layout editor view failing to inflate in release builds. R8 strips constructors the app never calls, and plugins load the app's shrunk copy of shared libraries. The reported cause, NavigationRailView(Context, AttributeSet), was fixed by ADFA-5731 (#1830): all 178 events across F2/F3/F4/G4/GQ come from releases built before it.

The same failure is still on stage for other libraries. Checking layout-editor.cgp's references against the stage release dex finds R8-stripped members the plugin reaches. An unshrunk debug dex was used as a control to rule out version skew.

  • sora CodeEditor(Context, AttributeSet): the Show XML screen fails to inflate, then the same NPE as this issue
  • CardView(Context), ViewPager(Context): the CardView and ViewPager palette items throw NoSuchMethodError
  • 14 sora members called by the plugin's bundled TextMate highlighter

This keeps io.github.rosemoe.sora, androidx.cardview and androidx.viewpager.widget whole. After the change, all 17 of those members resolve, for +328 KiB of dex.

Left alone: 115 more stripped members referenced only by the plugin's bundled copies of library classes (Glide, preference, transition, ...), none referenced directly by the plugin's own code or layouts. Also 31 version-skew members (newer activity/lifecycle/coroutines in the plugin than the app ships), which R8 doesn't cause.

…s to R8

The GlitchTip issue (CODEONTHEGO-F2, and F3/F4/G4/GQ with the same
cause) is a layout editor view failing to inflate in release builds:
NoSuchMethodException on NavigationRailView(Context, AttributeSet),
then the "Missing required view" NPE from the plugin's view binding.
Plugins load parent-first, so they get the app's shrunk copy of a
library it shares with them. ADFA-5731 (#1830) fixed that class by
keeping com.google.android.material whole; all 178 events come from
releases built before it.

The same failure is still on stage for other shared libraries. Checking
layout-editor.cgp's references against the stage release dex, and
against an unshrunk debug dex to rule out version skew, finds members
R8 strips that the plugin reaches:

- sora CodeEditor(Context, AttributeSet), inflated by the Show XML
  screen: the same inflation failure and NPE as this issue
- CardView(Context) and ViewPager(Context), constructed by the
  CardView and ViewPager palette items: NoSuchMethodError
- 14 sora members (Span.setExtra, Logger, ...) called by the plugin's
  bundled TextMate highlighter: NoSuchMethodError

Keep io.github.rosemoe.sora, androidx.cardview and
androidx.viewpager.widget whole, like the other shared libraries.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

@coderabbitai

coderabbitai Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Essentials

Run ID: ab45cfb0-7e86-4c74-bbd8-fd49ef79d1ce

📥 Commits

Reviewing files that changed from the base of the PR and between 785b7af and 050e851.

📒 Files selected for processing (1)
  • app/proguard-rules.pro

Included review availability: This review used your included allowance. 4 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.


📝 Summary
  • Added ProGuard keep rules for io.github.rosemoe.sora, androidx.cardview, and androidx.viewpager.widget. The rules preserve all classes and members in these packages so R8 does not remove members used by the layout editor plugin.
  • Risk: Keeping entire packages increases app size. The PR description estimates an increase of 328 KiB of dex.

Walkthrough

The ProGuard configuration adds rules to keep all classes and members in the io.github.rosemoe.sora, androidx.cardview, and androidx.viewpager.widget packages.

Changes

ProGuard Configuration

Layer / File(s) Summary
Package keep rules
app/proguard-rules.pro
Adds rules to keep all classes and members in three packages.

Priority: ⬆️ High

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Bug fix

Suggested reviewers: davidschachteradfa

Merge Risk: ⚪ Minimal · up to 050e8

The host dex will retain the shared-library members needed by the layout editor plugin. No actionable merge-blocking risk is established.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the issue and the primary change: keeping app libraries that the layout editor plugin loses to R8.
Description check ✅ Passed The description directly explains the R8 issue, affected libraries, observed failures, scope, and expected dex-size impact.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


A rabbit checks the rules in place
Three packages keep their classes safe
No names are trimmed away
Their members stay in place
Then hops through fields of green today

Comment @coderabbitai help to get the list of available commands.

@Daniel-ADFA
Daniel-ADFA requested a review from a team October 2, 2026 08:08
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.

3 participants