I'm trying to implement Gradle Version Catalogs on...
# gradle
a
I'm trying to implement Gradle Version Catalogs on my project but I got this error!!
e
what Gradle version? https://github.com/gradle/gradle/pull/17394 landed in 7.2
a
Gradle version is 7.4.2
c
Have you refreshed the Gradle project, allowing Gradle to generate the accessors?
if those are defined in the toml file as plugins, the accessor syntax is
libs.plugins.<alias>
e
if they're defined in
[plugins]
they should be used in the
plugins { alias(libs.plugins.<alias>) }
.
buildscript.dependencies.classpath
takes regular libs. but you should be using
plugins
for plugins to begin with
but also always check a command-line build first - IDEA/Android Studio do not support version catalogs very well
a
so I have to build the project from the command line ?
c
no. sometimes the IDE doesn’t correctly show version catalog accessors working, but the build is fine. The ask is to test this from the command line to see if this is the case. You may also need to correct the accessor syntax / use of plugin{} block.
e
1. you need to re-sync for IDEA to see changes in the generated accessors 2. even a working project will show errors in IDEA. (it will build, the IDE just shows errors falsely) 3. if your project isn't working, debug it from a command-line build
a
I understand I will work on it Thank you both of you ❤️ for the instructions
f