Status Update
Comments
vi...@google.com <vi...@google.com>
xo...@google.com <xo...@google.com>
xo...@google.com <xo...@google.com> #2
Thanks for the report, and sorry for taking so long to get to this. It turns out to be quite the can of worms.
I think the operation of consumerProguardFiles
on any kind of module that was not a com.android.library
has never been documented. At least, I couldn't find anything. I did some investigation and much to my surprise, consumerProguardFiles
in a dynamic-feature
module are indeed handed over to the base module and used inputs to the shrinker.
This is problematic, because independently of this, consumerProguardFiles
was removed from the DynamicFeature
build variant interfaces in version 8.0 of AGP -- that's the change that is motivating this refactoring in the AGP Upgrade Assistant. If your build file is expressed in Kotlin Script, it is simply not possible to use consumerProguardFiles
from a dynamic feature module any more: you'd get Kotlin compilation errors whenever you tried to use gradle, or sync the project. However, if the build is expressed in Groovy, the late-binding nature means that the implementation class is used instead of an interface, and the implementation class still has this property, so everything keeps on working.
I've changed the AGP Upgrade Assistant not to remove consumerProguardFiles
from dynamic feature modules written in Groovy; this change should be available from Android Studio Jellyfish Canary 12. We still have to remove consumerProguardFiles
in dynamic feature modules for Kotlin Script build files, even though they're potentially meaningful, because there just is no way to express their use directly. If you are using a Kotlin Script build file, the workaround is to move those consumer proguard files to the main application module (as proguardFiles
).
I've opened an issue on AGP to allow the use of consumerProguardFiles
in dynamic feature modules again, and/or to provide some other way to provide proguard files to the base module from the dynamic feature. Once that has been resolved, we'll update the AGP Upgrade Assistant again to smooth the upgrade path.
Thank you once again for the report.
an...@google.com <an...@google.com> #3
Thank you for your patience while our engineering team worked to resolve this issue. A fix for this issue is now available in:
- Android Studio Jellyfish | 2023.3.1 Canary 12
- Android Gradle Plugin 8.4.0-alpha12
We encourage you to try the latest update.
If you notice further issues or have questions, please file a new bug report.
Thank you for taking the time to submit feedback — we really appreciate it!
Description
Running "AGP Upgrade Assistent" leads to a step labeled "Remove ignored configuration properties". Running this steps, removes android.defaultConfig.consumerProguardFiles from a dynamic feature module. But consumerProguardFiles does not seem to be ignored. In my case, it contains the rules allowing the release build to succeed.