dave08
01/28/2024, 10:56 AMdave08
01/28/2024, 12:14 PMJavier
01/28/2024, 12:47 PMalias
and do get()
from the libs…
and pick the id
. Apply it using id(libs…)
Javier
01/28/2024, 12:49 PMdave08
01/28/2024, 12:52 PMJavier
01/28/2024, 12:53 PMdave08
01/28/2024, 12:53 PMJavier
01/28/2024, 12:54 PMdave08
01/28/2024, 12:55 PMplugins {
id(libs.plugins.kotlin.jvm.get().pluginId) apply false
id(libs.plugins.android.application.get().pluginId) apply false
// alias(libs.plugins.android.library) apply false
// alias(libs.plugins.android.test) apply false
alias(libs.plugins.firebase.crashlytics) apply false
alias(libs.plugins.firebase.perf) apply false
alias(libs.plugins.gms) apply false
id(libs.plugins.ksp.get().pluginId) apply false
id(libs.plugins.hilt.get().pluginId) apply false
}
dave08
01/28/2024, 12:55 PMclass AndroidAppPlugin : Plugin<Project> {
override fun apply(target: Project) {
with(target) {
val libs = the<LibrariesForLibs>()
with(pluginManager) {
apply("com.android.application")
apply("org.jetbrains.kotlin.android")
apply("dagger.hilt.android.plugin")
apply("com.google.devtools.ksp")
}
dave08
01/28/2024, 12:55 PMclass AndroidLibraryPlugin : Plugin<Project> {
override fun apply(target: Project) {
with(target) {
val libs = the<LibrariesForLibs>()
with(pluginManager) {
apply("com.android.library")
apply("org.jetbrains.kotlin.android")
apply("dagger.hilt.android.plugin")
apply("com.google.devtools.ksp")
}
dave08
01/28/2024, 12:56 PMdependencies {
implementation(files(libs.javaClass.superclass.protectionDomain.codeSource.location))
implementation("com.android.tools.build:gradle:" + libs.versions.agp.get())
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:" + libs.versions.kotlin.get())
Javier
01/28/2024, 12:56 PMdave08
01/28/2024, 12:58 PMdave08
01/28/2024, 12:58 PMJavier
01/28/2024, 1:06 PMdave08
01/28/2024, 1:08 PMorg.gradle.api.plugins.UnknownPluginException: Plugin [id: 'com.google.devtools.ksp', apply: false] was not found in any of the following sources:
- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (plugin dependency must include a version number for this source)
at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.resolveToFoundResult(DefaultPluginRequestApplicator.java:274)
at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.lambda$resolvePluginRequests$3(DefaultPluginRequestApplicator.java:199)
at org.gradle.util.internal.CollectionUtils.collect(CollectionUtils.java:212)
at org.gradle.util.internal.CollectionUtils.collect(CollectionUtils.java:206)
at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.resolvePluginRequests(DefaultPluginRequestApplicator.java:197)
at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.resolvePluginRequests(DefaultPluginRequestApplicator.java:113)
at org.gradle.plugin.use.internal.DefaultPluginRequestApplicator.applyPlugins(DefaultPluginRequestApplicator.java:102)
at org.gradle.kotlin.dsl.provider.PluginRequestsHandler.handle(PluginRequestsHandler.kt:44)
at org.gradle.kotlin.dsl.provider.StandardKotlinScriptEvaluator$InterpreterHost.applyPluginsTo(KotlinScriptEvaluator.kt:217)
at org.gradle.kotlin.dsl.execution.Interpreter$ProgramHost.applyPluginsTo(Interpreter.kt:385)
dave08
01/28/2024, 1:10 PMdave08
01/28/2024, 1:15 PMdave08
01/28/2024, 2:11 PMVampire
01/28/2024, 2:43 PMSo I'm wondering where the versions DO get resolved?Where you have
alias(libs.plugins...)
because the entry coming from the version catalog has the versionVampire
01/28/2024, 2:44 PMdave08
01/28/2024, 3:35 PMalias
anywhere... yeah, I wasn't sure if this was on-topic, things are sometimes a bit on the brink of Kotlin or not Kotlin... (and I have tried other communities in the past... they're not as friendly and helpful as here 😊... and it's not so nice to get answers in Groovy when you're writing Kotlin in Gradle scripts, IF they answer at all...)Vampire
01/28/2024, 5:54 PMVampire
01/28/2024, 5:54 PMVampire
01/28/2024, 5:56 PMFor android application plugin, I don't useWell, hard to guess without seeing the actual build 🙂anywherealias
Vampire
01/28/2024, 5:57 PMVampire
01/28/2024, 5:57 PMbuildSrc
you have an implementation dependency on AGP just as @Javier said already way upVampire
01/28/2024, 5:58 PMJavier
01/28/2024, 6:01 PMbuildSrc
I ended up adding all plugins as implementation
there and the root project has no apply false
plugins.Vampire
01/28/2024, 6:01 PM