You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The documentation defined here says we should use libs.versions.yourVersion.get() to retrieve values declared in version catalog's versions block, but in fact this method only works if you add .asProvider() before the get() function.
Incorrect example: libs.versions.compose.get()
Working example: libs.versions.compose.asProvider().get()
Expected Behavior
In a gradle file we should be able to retrieve version values using libs.versions.yourVersion.get()
Current Behavior
In a gradle file when using .get() function in a previously declared version of the version catalog an "unsolved reference" error is thrown, as we can see in the picture below:
Context
I was migrating my app from groovy + buildscript extensions to kotlin-dsl + version catalogs. To declare that a module can use Jetpack compose we must assign the compiler version to be used with compose (which is the same value of the current compose version), and then when i tried to use libs.versions.compose.get()the error occurred.
Steps to Reproduce
Enable version catalogs in your project
Create a version catalog TOML file
Declare a value in the versions block
Try to access the value using libs.versions.yourValue.get()
Notice the unsolved reference error
Your Environment
MacOs Monterey
Gradle Version 7.4.2
Android Gradle Plugin 7.1.2
Android Studio Version Bumblebee 2021.1.1 Patch 2
The text was updated successfully, but these errors were encountered:
This is actually almost true. If there's a nested accessor, you need to call asProvider() first. So here you need to call asProvider() because you have a child node to compose I guess.
Accessing the value of a catalog item whose alias is a prefix of some other alias is a special
case that requires `asProvider()`. Reflect that in the docs for version catalogs.
Fixes#20370
The documentation defined here says we should use
libs.versions.yourVersion.get()
to retrieve values declared in version catalog's versions block, but in fact this method only works if you add.asProvider()
before theget()
function.Incorrect example:
libs.versions.compose.get()
Working example:
libs.versions.compose.asProvider().get()
Expected Behavior
In a gradle file we should be able to retrieve version values using
libs.versions.yourVersion.get()
Current Behavior
In a gradle file when using
.get()
function in a previously declared version of the version catalog an "unsolved reference" error is thrown, as we can see in the picture below:Context
I was migrating my app from groovy + buildscript extensions to kotlin-dsl + version catalogs. To declare that a module can use Jetpack compose we must assign the compiler version to be used with compose (which is the same value of the current compose version), and then when i tried to use
libs.versions.compose.get()
the error occurred.Steps to Reproduce
libs.versions.yourValue.get()
Your Environment
The text was updated successfully, but these errors were encountered: