-
Notifications
You must be signed in to change notification settings - Fork 229
Restore legacy shrinking configuration for AGP 8.4.x
#2867
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
Restore legacy shrinking configuration for AGP 8.4.x
#2867
Conversation
The current one is causing issues with release builds and no changes in proguard rules seem to fix them.
📱 Scan the QR code below to install the build (arm64 only) for this PR. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #2867 +/- ##
========================================
Coverage 74.06% 74.06%
========================================
Files 1530 1530
Lines 36542 36542
Branches 7055 7055
========================================
Hits 27064 27064
Misses 5791 5791
Partials 3687 3687 ☔ View full report in Codecov by Sentry. |
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.
LGTM, thanks.
@@ -59,3 +59,6 @@ android.enableBuildConfigAsBytecode=true | |||
|
|||
# By default, the plugin applies itself to all subprojects, but we don't want that as it would cause issues with builds using local AARs | |||
dependency.analysis.autoapply=false | |||
|
|||
# Disabled new R8 shrinking for local dependencies as it causes issues with release builds | |||
android.disableMinifyLocalDependenciesForLibraries=false |
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.
Weird that the value is false
, it would be more logical to have true
, but https://developer.android.com/build/releases/gradle-plugin#library-classes-shrunk is not clear about it.
If it fixes the issue, that's fine!
Co-authored-by: Benoit Marty <[email protected]>
|
Type of change
Content
Disable the new way of shrinking code added in AGP 8.4.0.
Motivation and context
It's causing issues with release builds and no changes in proguard rules seem to fix them.
i.e.
That
missing_rules.txt
files just contains-dontwarn
entries that do remove the errors while building, but then the classes aren't present in the resulting APK and the app instantly crashes on boot.Adding
--keep class io.element.android.foo.SomeMissingClass { *; }
does nothing either.Tests
We should be able to build nightlies again with this change.
This nightly build flow based on this branch built the apk just fine: https://github.com/element-hq/element-x-android/actions/runs/9124298023/job/25089536772
Checklist