I am starting a new project by using the architecture-templates by google (https://github.com/android/architecture-templates)
In this template, they use Gradle with Kotlin DSL. I am trying to add Crashlytics to this project but the structure of gradle is quite different from my old projects.
I am stuck on the step 2 of the base guide (Firebase Get Started Documentation)
Error resolving plugin [id: ‘com.android.application’, version:
‘7.3.1’]The request for this plugin could not be satisfied because the plugin is already on the classpath with an unknown version, so
compatibility cannot be checked.
Any suggestion?
2
Answers
After some research I found that the architecture template is based on gradle 7.6 which use the version catalog feature.
So I based my Version Catalog file on this https://github.com/RedMadRobot/gradle-version-catalogs/blob/main/versions-stack/libs.versions.toml
Now my build.gradle.kts file is
I used to be confused about this too, but after some tries, I found the correct answer.
I think this is the first point of step 2 where you are confused. Just add the following code at the top of the project level build.gradle:
Just follow the Google guide for the rest.
Complete code:
Edited:
DSL version:
This website(Gradle Kotlinize – Groovy to Kotlin converter online) may be able to help you.