Ship consumer ProGuard rules fixing minified-build crashes - #16
Open
Jintin wants to merge 1 commit into
Open
Conversation
consumer-rules.pro was wired into the library but empty, so R8 stripped the Signature attribute consumers' apps need for findClass() to resolve the binding type, crashing every BindingActivity/BindingFragment at launch in minified builds. Fixes #11 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Jintin <jintin.lin1018@gmail.com>
Jintin
force-pushed
the
fix/consumer-proguard-rules
branch
from
August 8, 2026 01:41
bfb8267 to
e353c7f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
consumer-rules.prowas already wired viaconsumerProguardFilesbut the file was empty, so consumers' minified builds crash at first Activity launch: R8 strips theSignatureattribute,findClass()inUtils.ktnever sees aParameterizedType, walks pastObject, and throws (javaClass.superclass must not be null/ NPE).This ships the rules with the library so every consumer gets them automatically:
-keepattributes Signature— the piece the README's suggested rule was missing, which is why NullPointerException when proguard is enabled #11's reporter still crashed with theinflatekeep appliedBindingActivity/BindingFragmentsubclasses so the supertype walk survives class merging/obfuscationinflate(...)/bind(...)on allViewBindingimplementations (supersedes the manual README step)Verified in PM25-Android: same crash reproduced in its first R8-enabled release build; these rules fix it.
Fixes #11
🤖 Generated with Claude Code