fix: wire merge classes to asm transformer#417
Merged
Conversation
artus9033
requested changes
Jul 7, 2026
artus9033
left a comment
Collaborator
There was a problem hiding this comment.
Awesome work! Left three comments, 2 may be major.
Comment on lines
-44
to
+23
| MergeProcessor.mergeClassesJarIntoClasses(project, aarLibraries, outputDir) | ||
| if (isMinifyEnabled) { | ||
| MergeProcessor.mergeLibsIntoClasses(project, aarLibraries, jarFiles, outputDir) | ||
| if (!isDebuggable) { |
Collaborator
There was a problem hiding this comment.
Previously, we used to check for isMinifyEnabled. I'm wondering: aren't we missing handling of this case? If any consumer enables minify on the brownfield library module, will embedded libs/*.jar from dependencies be merged?
Member
Author
There was a problem hiding this comment.
This check was not doing any work as the jarFiles would always contain an empty list. Verified locally by enabling minification for brownfieldlib and we only need to adjust the proguard-rules and add consumer-rules to our packages like brownie, navigation and brownfield, which I will do in a follow-up PR.
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.
Summary
This PR fixes a bug in which the final merged
classes.jardid not contain the third party libraries. This bug was introduced after the BGP optimizations. We did not face any issues until now because running theassembleorbundlecommand after the first time, gets the final mergedclasses.jarto have the third party libraries.In our usual flow, we first run
package:aarand thenpublish:aar, so we did not face this issue, however as part of #413 this issue became evident as Expo SDK 57 clears the native directories and regenerate those on each prebuild invocation.To fix it, we bring back the code which was responsible to handle this. We create a custom
MergeClassestask and wire it to be a dependency oftransformClassesWithAsmgradle task.Test plan