-
Notifications
You must be signed in to change notification settings - Fork 3
[CDX-351] Fix build issue #157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes a build issue by correcting the package naming convention in ProGuard rules from constructor.io to io.constructor and adds consumer ProGuard rules to ensure proper code preservation in consuming applications.
- Corrected package name format in ProGuard keep rules from reverse domain notation to standard Java package notation
- Added new consumer ProGuard rules file with Moshi serialization and SDK model preservation rules
- Configured the library's release build to include consumer ProGuard rules
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| library/proguard-rules.pro | Fixed package names from constructor.io.* to io.constructor.* format |
| library/consumer-rules.pro | Added new consumer ProGuard rules for Moshi annotations and SDK model classes |
| library/build.gradle | Configured release build to include consumer ProGuard rules file |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Code Review SummaryThis PR addresses a critical build issue by adding consumer ProGuard rules that are bundled with the library's AAR and automatically applied to consuming applications. The changes include:
The changes are well-structured and follow Android library best practices for ProGuard configuration. Detailed Feedback✅ [File:
|
Fix R8/ProGuard Obfuscation for Release Builds
Problem
SDK fails in release builds with R8 enabled:
R8 obfuscates
@FromJsonmethod signatures, breaking Moshi's reflection-based adapter discovery.Solution
Bundle ProGuard rules with the AAR via
consumerProguardFiles. Rules auto-apply when consumers build with minification.Changes
consumer-rules.probuild.gradleconsumerProguardFiles 'consumer-rules.pro'proguard-rules.proconstructor.io→io.constructorRules Applied
Backwards Compatibility