Modern Dependency Management With Version Catalogs - Android Studio Tutorial 💻

แชร์
ฝัง
  • เผยแพร่เมื่อ 29 พ.ย. 2024
  • In this video I will show you an Android Studio Tutorial about Modern Dependency Management With Version Catalogs!
    💻 Let me be your mentor and become an industry-ready Android developer in 10 weeks:
    pl-coding.com/...
    ⭐ Courses with real-life practices
    ⭐ Save countless hours of time
    ⭐ 100% money back guarantee for 30 days
    ⭐ Become a professional Android developer now:
    pl-coding.com/...
    🎁 Get my FREE 4.5h course "The Best Practice Guide to Android Architecture":
    pl-coding.com/...
    Read our weekly Android blog:
    pl-coding.com/...
    Regular programming advice on my Instagram page: / _philipplackner_
    Join my Discord server:
    / discord

ความคิดเห็น • 109

  • @johngray2875
    @johngray2875 9 หลายเดือนก่อน +8

    You can also have a bundles section, where you set up way add multiple dependencies will a single line. It's very handy for things you always use together. Like all the compose dependencies.

  • @romanosp9349
    @romanosp9349 8 หลายเดือนก่อน +5

    Will you make a video combining versionCatalog with buildSrc ?

  • @Otabek001uz
    @Otabek001uz 9 หลายเดือนก่อน +16

    You're the best, Native developer!!!

  • @annaberkovitch85
    @annaberkovitch85 6 หลายเดือนก่อน

    Ah! This is great. Been working on the same big project for a while, so when i created a new project in Jellyfish for a small app this morning and went to add dependencies, the first reaction seeing the libs system was "WTF!?". Was tempted to revert back, but the OCD had won 😂
    After it had taken me the best part of the morning to figure out the version catalog system on my own and add all my drpendencies manually, decided to migrate my big project... for which this video was, as usual, A GODSEND!
    Seriously, you're a lifesaver ❤

  • @Narazgul
    @Narazgul 9 หลายเดือนก่อน +7

    In addition to your content I'm also making use of "bundles" there. For example all the compose dependencies could be bundle together and instead of 4 implementation you only got 1 left in your gradle file. But that's of course an indivuall preference 🙂

    • @PhilippLackner
      @PhilippLackner  9 หลายเดือนก่อน +5

      Haven't found much use for that yet, since in a single module app, you'll have to add them all to your Gradle file anyways and in a multi-module project, I got used to work with convention plugins which also didn't make me feel like that was necessary. Still thanks for adding though!

    • @mytubekt
      @mytubekt 9 หลายเดือนก่อน +1

      Bundles are very nice approach, we are also using to group dependencies and use them as single line in gradle file.

    • @rishabh-more
      @rishabh-more 9 หลายเดือนก่อน

      @@PhilippLackner I can't believe it. Bundles make my life soo much easier, even if I'm also using Convention Plugins. Just wrap all the multiple dependencies for one library such as Koin or Retrofit and then just call your bundle in one line. It's soo good!!

  • @abada-s
    @abada-s 9 หลายเดือนก่อน +9

    I hope to see a new video about buildSrc module that supports this toml file

  • @dahlola
    @dahlola 9 หลายเดือนก่อน

    Another nice feature is that you can create "bundles". So say that you have related dependencies like compose for instance, then you can create a bundle of these. You can then in you app gradle file just refer to "implementation(libs.bundles.compose)" for instance.

  • @嘿嘿嘿-z1v
    @嘿嘿嘿-z1v 2 หลายเดือนก่อน

    Now I'm using Android Studio Koala and it already appled the version catalogs for the library dependencies. Thanks for your information 6 months ago :)

  • @vighnesh153
    @vighnesh153 9 หลายเดือนก่อน

    This is nice and definitely makes it easier to manage dependencies for large projects. When I look at build scripts that use version catalogs, I just find it a bit hard to build a mental model of dependencies. Before version catalogs, it was easier on the eyes to figure out what "groups" we are using in our application.

  • @Pulkit__7
    @Pulkit__7 4 หลายเดือนก่อน

    Great Video Philipp.
    Rant:-
    IDE support for this is worse, why don't Android Studio, just create a simple GUI interface, which makes it easier.
    Upgrading is mess, unused libraries in version catalogue is a mess.
    I don't like the new way of doing things, it's like we are intentionally making it difficult to import libraries, but as long as we get paid, eh.

  • @readysetgo4468
    @readysetgo4468 7 หลายเดือนก่อน +1

    this was helpful i was watching an old tutorial on app development that was released on 2021 and i was confused as to why my dependency lines were red while his was fine XD

  • @McMouse88
    @McMouse88 8 หลายเดือนก่อน

    It would be nice to mention about bundle in version catalog. And it would be pretty convenient if version catalog has opportunity to define groups like versions )))

  • @robertfontaine3650
    @robertfontaine3650 9 หลายเดือนก่อน

    Nice to see this is being done. Sad that I did this all manually and now I have to unwind it. :)

  • @tarsilacostalonga
    @tarsilacostalonga 8 หลายเดือนก่อน +1

    Great video, Philipp!
    Is it possible to use the versions catalog and group dependencies like you did in the video "Perfect Dependency Management"? I mean, call room() and add all the dependendencies related to it.

    • @germenwong
      @germenwong 6 หลายเดือนก่อน

      of course,You can use a bundle

  • @tasnimulhasan7329
    @tasnimulhasan7329 9 หลายเดือนก่อน

    thanks for this video. this tutorial helped me a lot upgrading my gradle from to old and I now understand toml very well. thanks again bro

  • @dhimanpaul3772
    @dhimanpaul3772 4 หลายเดือนก่อน

    this is very helpful for me . for this i can use string dependencies to library dependencies.
    thank you .

  • @riezkymaisyar4038
    @riezkymaisyar4038 9 หลายเดือนก่อน +3

    thanks philips, this is great 🤙

  • @argahutama
    @argahutama 9 หลายเดือนก่อน +2

    How about Version Catalogue vs Gradle Kotlin DSL comparation?

  • @vitalijuskolinko9011
    @vitalijuskolinko9011 9 หลายเดือนก่อน

    Thank you for great video! :)
    I'm trying to migrate from buildSrc Deps object in KMM to that catalogs ;)
    P.S.: Don't forget to update KMM Translator ;)
    P.S.S.: The name of lib in 21 line should be androidx-compose-ui-test-manifest ;)

  • @robertfontaine3650
    @robertfontaine3650 9 หลายเดือนก่อน

    Updated to the nosebleed version of android studio, ksp, jdk 21 etc. Dependency management is nice. They have done something new with resources as well. factoring and refactoring and rere.... I swear building the framework for an application takes longer than writing the logic. For MVVM I should just be able to configure the entities and click generate. stub the business logic and save a bunch of time. by the time you write 3 mvvm applications it's going to get pretty dull

  • @mohancena8970
    @mohancena8970 8 หลายเดือนก่อน +1

    will you update multi-module course with version catalogs instead buildSrc ??

  • @itssinghankit
    @itssinghankit 9 หลายเดือนก่อน +3

    They are just increasing complexity, adding dependency is much easier in other frameworks, this is the thing which i don't like about android.

  • @leunamvon2565
    @leunamvon2565 7 หลายเดือนก่อน

    King of Android.

  • @hassanjamil841
    @hassanjamil841 9 หลายเดือนก่อน

    Great video to know about the version catalog ❤

  • @v4lde3c0
    @v4lde3c0 8 หลายเดือนก่อน

    your videos are very top! Thank you so much for sharing your knowledge.
    😍🤩🥳❤🙏

  • @eliasshemsu5853
    @eliasshemsu5853 9 หลายเดือนก่อน

    This is awesome, man!

  • @aditya_rajive
    @aditya_rajive 9 หลายเดือนก่อน

    Would be great if you could make a video on automating Gradle dependency updates through Github Actions.

  • @barfyman3Six2
    @barfyman3Six2 9 หลายเดือนก่อน +1

    I'm been using this for 2 years now. It's a big improvement but I still don't like the TOML file format.

  • @niharranjan3556
    @niharranjan3556 8 หลายเดือนก่อน

    Thanks Philipp for your great work ! I have seen gradle team has inculded this video link in their latest newsletter published for march, 2024. I have a question related to it though, appreciate if you can point me to something. With version catalog added to my project, I am not able to generate a gradle.lock file, and it always fails to identify the dependencies. There are multiple open bugs pending with gradle for the same and gradle team not showing the appetite to fix those as well.

  • @Esloquees
    @Esloquees 3 หลายเดือนก่อน

    Invalid catalog definition: - Problem: In version catalog libs, you can only call the 'from' method a single time. (i called just one time, what is wrong?)
    dependencyResolutionManagement {
    versionCatalogs {
    create("libs") {
    from(files("gradle/libs.versions.toml"))
    }
    }
    }

  • @GeertBerkers
    @GeertBerkers 8 หลายเดือนก่อน +1

    Can you also do this with hilt dependency injection? I cant make ik work.

  • @SiamakAshrafi
    @SiamakAshrafi 9 หลายเดือนก่อน

    Version Catalogs are the default in Android Studio Jellyfish | 2023.3.1 Canary 11

  • @gabrielabanica615
    @gabrielabanica615 5 หลายเดือนก่อน

    Something is not clear for me. For example, if we use timber library we can use :
    timber="5.0.1"
    timber = { group = "com.jakewharton.timber", name="timber",version.ref="timber"}
    timber = { module = "com.jakewharton.timber:timber",version.ref="timber"}
    ? It is the same thing if we use group or module? I don't understand the difference between them.

  • @Adorabledaivikshorts
    @Adorabledaivikshorts 9 หลายเดือนก่อน

    Hi Philip Kindly Make an App Demo for a Live Streaming app For HLS or TH-cam Using Jetpack Compose and Kotlin.

  • @DanielLuche
    @DanielLuche 9 หลายเดือนก่อน

    I'm using version catalog for a while but I didn't know that was possible uses the shortcuts to move build.gralde depencies into toml file.

  • @ngenge_senior
    @ngenge_senior 9 หลายเดือนก่อน

    Thanks for this Philipp

  • @utubenada
    @utubenada 9 หลายเดือนก่อน

    Very cool. BTW. Should androidx-compose-tooling-ui-manifest be named androidx-copmose-ui-test-manifest?

  • @excalibur8147
    @excalibur8147 8 หลายเดือนก่อน +1

    Came here to solve the same problem at 12:56 (material reference error) and you cut how you solved it :/
    update: New projects don't include old material dependency, only material3

  • @Allpcgeek
    @Allpcgeek 3 หลายเดือนก่อน

    Thank so much, understood thanks

  • @RahulKumar-et4pm
    @RahulKumar-et4pm 3 หลายเดือนก่อน

    how can we add classpaths and how to find the proper versions of the plugin

  • @that1angrykraken
    @that1angrykraken 7 หลายเดือนก่อน

    how do we defind a dependency to a module when using version catalog?

  • @martinseal1987
    @martinseal1987 9 หลายเดือนก่อน +1

    Can we have more of your opinions? If you dont want to put then on the main channel i understand

    • @PhilippLackner
      @PhilippLackner  9 หลายเดือนก่อน +1

      Opinions about what specifically? 😄

  • @moldovanpeter5123
    @moldovanpeter5123 9 หลายเดือนก่อน +1

    We have the same + build conventions

  • @jacqueswho
    @jacqueswho 9 หลายเดือนก่อน

    I prefer your approach to using kotlin build src folder with variables and so forth. Its easier to manage and clean. Or am i missing something?

    • @gamermom1945
      @gamermom1945 9 หลายเดือนก่อน

      You don't get the hint that there are newer versions if you use that approach

  • @entorterradofotossintetizante
    @entorterradofotossintetizante 9 หลายเดือนก่อน

    I’m waiting for the day when they’ll create a dependency manager like Rust’s Cargo or JavaScript’s npm.

    • @vighnesh153
      @vighnesh153 9 หลายเดือนก่อน

      I have worked in Javascript land for over 3 years of my life and felt like nothing is better. But after working with Gradle for a year, I have realized why it is superior than NPM. I am not saying it is the best, but it is definitely better than NPM.

  • @briantaylor_
    @briantaylor_ 9 หลายเดือนก่อน +1

    would you say this is more ideal than using a buildSrc in a multi-module app?

    • @PhilippLackner
      @PhilippLackner  9 หลายเดือนก่อน +1

      Yes

    • @briantaylor_
      @briantaylor_ 9 หลายเดือนก่อน

      thanks @@PhilippLackner would love to see a video comparing buildSrc vs Version Catalogs with some pros and cons of each

    • @MarkOverton-fn4gm
      @MarkOverton-fn4gm 9 หลายเดือนก่อน +1

      Hi @PhilippLackner, I am busy doing your Multi-Module Architecture paid course and I just finished the Module Setup video. Am I correct in assuming that the Version Catalogue can completely replace the buildSrc method of managing dependencies? And will you update your course with the Version Catalogue method?

    • @PhilippLackner
      @PhilippLackner  9 หลายเดือนก่อน +1

      @@MarkOverton-fn4gm yes you are

  • @emreyigit7671
    @emreyigit7671 7 หลายเดือนก่อน

    Thank you philipp :)

  • @Yannis1968-9
    @Yannis1968-9 8 หลายเดือนก่อน

    I tried recreating your room beginner project with this version catalog android studio and I keep getting an error with classes conflicts

  • @SurjanHevin
    @SurjanHevin 8 หลายเดือนก่อน +1

    How to add kotlin-kapt

  • @koncinar
    @koncinar 9 หลายเดือนก่อน

    "Finally, developers can now use one language, Kotlin, for the logic, UI and also build config"
    "Unacceptable, let's bring in a completely new language without logic, code completion or even type safety. We'll build an extra tool to handle that."
    "Emmm, ok. We could then group the libraries together. For example with a dot like in the rest of the code?"
    "Boooooring, let's use dash on one side and dot on the other. So that they can't do a litelar search. Wink wink"

  • @Rishisingh-s9h
    @Rishisingh-s9h 9 หลายเดือนก่อน

    i am learning android using your old projects but i am facing issue in your news app. I am stuck at a point from 3 days but i don't get any solution.i am using new version of android that is hedgehog. Please tell me what should i do?

  • @jackc-gw7630
    @jackc-gw7630 9 หลายเดือนก่อน

    Hey your location tracking app doesnt seem to auto update anymore, do you know why?

  • @IgnitedMindsMotiviational
    @IgnitedMindsMotiviational 9 หลายเดือนก่อน

    What is the advantage of using this over the regular build.gradle?

    • @PhilippLackner
      @PhilippLackner  9 หลายเดือนก่อน +1

      One source of dependencies for multi module projects

    • @IgnitedMindsMotiviational
      @IgnitedMindsMotiviational 9 หลายเดือนก่อน

      @@PhilippLackner makes sense. did not think in that way. Good to know. Thanks for the video

  • @jamunaperumal3592
    @jamunaperumal3592 3 หลายเดือนก่อน

    How to add maven with pom , instead of using Gradle in android studio koala version

  • @МухаммадаминСалохиддинов
    @МухаммадаминСалохиддинов 9 หลายเดือนก่อน +1

    Hello world !

  • @CodeRedDevelopment
    @CodeRedDevelopment 9 หลายเดือนก่อน

    Do they also support notices about new versions of the dependencies?

    • @robchr
      @robchr 9 หลายเดือนก่อน

      Yes, there will be a yellow squiggly in the version catalog when there is a new version, just like in the build.gradle file.

    • @CodeRedDevelopment
      @CodeRedDevelopment 9 หลายเดือนก่อน

      @@robchr Great 🤩 This was always a problem some years ago back when I tried out own version catalogs by gradle ext.

  • @Diego-hn6oh
    @Diego-hn6oh 9 หลายเดือนก่อน

    Hi, I'm new to android developmet, is it better to get started with view xml or jetpack compose?

    • @pgnrr
      @pgnrr 9 หลายเดือนก่อน +1

      Compose all the way

    • @shashanksp9168
      @shashanksp9168 9 หลายเดือนก่อน

      compose , don't waste time learning xml !!

  • @martinseal1987
    @martinseal1987 9 หลายเดือนก่อน +13

    This is so bad, as if it wasn't complicated enough already they decided to add a new language file 😢, why can't we take an idea out of flutters playbook? Their pubspec file makes all of this so easy

    • @martinseal1987
      @martinseal1987 9 หลายเดือนก่อน +4

      I wrote this early in the video after seeing all the generated info this is so stupid

    • @tygourm
      @tygourm 9 หลายเดือนก่อน +6

      This feature has been out there for a while and is actually one of the best ways to handle dependancies in Gradle projects. All your dependencies for your modules are centralized, you get autocomplete for plugins and dependencies in your Gradle scripts, you can use bundles to make your dependencies sections even smaller ... I think that it should be the standard for that propose, give it a try and you'll see how good it is 😉

    • @martinseal1987
      @martinseal1987 9 หลายเดือนก่อน +1

      @@tygourm you're right I should but did we really need a new file type to learn

    • @martinseal1987
      @martinseal1987 9 หลายเดือนก่อน

      @@tygourm also I didn't realise how long this has been around I thought it was new

    • @martinseal1987
      @martinseal1987 9 หลายเดือนก่อน

      @@tygourm I hear you when you say it's the best way because the old way sucked I'm asking if this is a good

  • @ahmadzafar5786
    @ahmadzafar5786 7 หลายเดือนก่อน

    Why not they introduce yaml file like Flutter

  • @Feints4Days-dx5gd
    @Feints4Days-dx5gd 9 หลายเดือนก่อน +3

    This feels so unnecessarily over-engineered

    • @jackeblan
      @jackeblan 9 หลายเดือนก่อน +1

      You don't have to do this in a monolithic project. This is the best and recommended way in a multi-module project.

  • @mustafaammar551
    @mustafaammar551 9 หลายเดือนก่อน

    Thank you BRO

  • @4ytonly
    @4ytonly 6 หลายเดือนก่อน +2

    Can someone explain why use this!? It look like few steps more then before, and I don't see any extra benefits from doing stuff this way

  • @byaruhaf
    @byaruhaf 9 หลายเดือนก่อน +1

    Wouldn't using Version Catalogs be more relevant for Multi-Module Apps?

    • @PhilippLackner
      @PhilippLackner  9 หลายเดือนก่อน +4

      Yes, but it also becomes the standard for single module apps

    • @Pulkit__7
      @Pulkit__7 4 หลายเดือนก่อน

      Aha, now I see, the vision

  • @androidkotlin-6234
    @androidkotlin-6234 9 หลายเดือนก่อน +1

    how to create hilt plugin with version catalog? I didn't find instruction at docs.
    I was find it for dagger, not for hilt

  • @kalios01
    @kalios01 9 หลายเดือนก่อน

    My college faculty be like this could be done by creating val for version 😂

  • @vengateshm2122
    @vengateshm2122 9 หลายเดือนก่อน

    Bundles is missing here.

  • @WeCrackAllGames
    @WeCrackAllGames 4 หลายเดือนก่อน

    So the only thing this does is adding an extra file to your project. I don't like that approach.

  • @ALEX54402
    @ALEX54402 9 หลายเดือนก่อน

    Already know sir but thanks for the video ❤

  • @oleg12395
    @oleg12395 9 หลายเดือนก่อน

    👍

  • @Nonsense675
    @Nonsense675 6 หลายเดือนก่อน

    Hi Philip
    I am not able to add the Hilt dependency using this approach, as it gives this error:
    Duplicate class org.intellij.lang.annotations.Identifier found in modules annotations-12.0.jar -> annotations-12.0 (com.intellij:annotations:12.0) and annotations-23.0.0.jar -> annotations-23.0.0 (org.jetbrains:annotations:23.0.0)
    I have this in toml
    [versions]
    hiltCompiler = "1.2.0"
    [libraries]
    androidx-hilt-compiler = { group = "androidx.hilt", name = "hilt-compiler", version.ref = "hiltCompiler" }
    in build.gradle(apps)
    implementation(libs.androidx.hilt.compiler)
    see if if you could help here