Status Update
Comments
xa...@google.com <xa...@google.com> #2
Any plans to support this?
sp...@google.com <sp...@google.com>
za...@gmail.com <za...@gmail.com> #3
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.material3:material3-adaptive-navigation-suite:1.4.0-alpha07
androidx.compose.material3:material3-adaptive-navigation-suite-android:1.4.0-alpha07
je...@google.com <je...@google.com>
pa...@gmail.com <pa...@gmail.com> #4
Re Companion
usage, please be mindful of Groovy/Java users with @JvmField or @JvmStatic.
See a similar issue in another plugin:
xa...@google.com <xa...@google.com> #5
Yes, 100%. This needs to be a @JvmStatic
.
am...@google.com <am...@google.com> #6
I can see that there are couple of plugins that currently read public static field ANDROID_GRADLE_PLUGIN_VERSION
which is defined in com.android.Version
Adding commons
as a dependency of gradle-api
module to expose this field does not seem quite right. Duplicating logic to read version properties in api(like how build-model does it) also does not seem right. @xav, do you have any suggestion?
am...@google.com <am...@google.com> #7
It looks like com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION
in com.android.tools:common
is public and statically available and is an easy way to currently get the AGP version without resolving through AndroidComponent
. There are many external plugins that use this to get the current agp version. It would be nice to provide a parsed object in API. Maybe we can explore exposing parsed object from tools:common
instead of agp-api?
xa...@google.com <xa...@google.com> #8
we really want something in gradle-api
though. We probably want to migrate again from the version in commons
. If it means that for a little while the logic to build that version is duplicated, I think that's fine.
Curious what Chris thinks?
cm...@google.com <cm...@google.com> #9
I'm ok with pushing a static version of
val pluginVersion: AndroidPluginVersion
It's Ok for that one to read the version resource from the classpath directly, and throw if it's not available. I'm ok with making that properties file the contract - we haven't made a breaking change to it since it was introduced in 2016.
We probably need to leave the common one there ~indefinitely even if we deprecate it as there are to many things in reality that are brittle to it.
xa...@google.com <xa...@google.com> #10
Agreed. Let's keep the version in common
and just have a new version in gradle-api
.
am...@google.com <am...@google.com> #11
ag/24825984 introduces static AndroidPluginVersion::getCurrent() which returns the current Agp version.
an...@google.com <an...@google.com> #12
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 Iguana | 2023.2.1 Canary 13
- Android Gradle Plugin 8.3.0-alpha13
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
Currently this API is
internal
only and has to be resolved via theandroidComponents
extension, but this is a bit tedious and requires any plugins depending on it to be applied after AGP. Making this public and statically accessible would be super helpful for plugins that want to gate their behavior on which AGP version they're running alongside.