From 050e8513562992c4b942288094c13d4a779e162a Mon Sep 17 00:00:00 2001 From: Daniel Alome Date: Fri, 2 Oct 2026 07:49:27 +0100 Subject: [PATCH] ADFA-5500: Keep the app libraries the layout editor plugin still loses 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. --- app/proguard-rules.pro | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index d47e27c123..014985131f 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -257,6 +257,9 @@ -keep class io.noties.markwon.** { *; } -keep class com.google.gson.** { *; } -keep class org.snakeyaml.engine.** { *; } +-keep class io.github.rosemoe.sora.** { *; } +-keep class androidx.cardview.** { *; } +-keep class androidx.viewpager.widget.** { *; } -keep class com.google.firebase.** { *; } -keep class com.google.android.gms.** { *; }