Hello, I'm new to android development and gradle, ...
# community-support
c
Hello, I'm new to android development and gradle, and I'm running into the same issue over and over every time I try to import certain libraries. I am unable to type out the same text that older versions of gradle use (and most of the online instructions use the old version). One example is that in old versions of gradle you would type implementation("...") and the dependency would be typed inside of the quotes, while in the current version there are no quotes inside of the implementation() in the dependencies{}. I've been able to use the Project Structure dialog to find all of the dependencies that I need, but sometimes there are other parts of the code that need to be changed (and I can't find out how to change them in the right way). The current example I'm working with is adding kotlin serialization to my project. This is what the old version used: plugins { id 'org.jetbrains.kotlin.plugin.serialization' } When I type the 'org.jetbr...' information into the plugins { alias() } then it says that it has no idea what I'm talking about Also maybe I'm completely wrong about something here, because I just found my way to the official website and it is still using the different syntax. So maybe I accidentally ended up with an experimental extension that is poorly documented or something? I'm just struggling to find any resources online that could help explain to me what the difference is between what I'm looking at online and what my version of gradle wants me to do. https://plugins.gradle.org/plugin/org.jetbrains.kotlin.plugin.serialization
v
Please do not split topics across several threads. This makes following the conversation in the threads view very hard as the context of the other messages is missing. If you have additional information either edit the original message or post to its thread. Regarding the question, the syntax did not change, you still write it in quotes if you directly declare the dependency and can use
id
. When you do not use quotes, or in the plugins block use
alias
, you are not directly declaring a dependency / plugin, but you are using the version catalog feature (which I recommend using) and what you have to write depends on what you configured in the version catalog. See this for more information: https://docs.gradle.org/current/userguide/platforms.html Also, I strongly recommend to switch to Kotlin DSL. By now it is the default, you immediately get type-safe build scripts, actually helpful error messages if you mess up the syntax, and an amazingly better IDE support if you use a good IDE like IntelliJ IDEA or Android Studio.
c
Thank you for the response. I've also condensed my message for the thread
👌 1