I am attempting to import a ksp dependency, but wh...
# gradle
z
I am attempting to import a ksp dependency, but when I do
ksp()
it shows up as an unresolved reference. In an attempt to add ksp to my project, I followed the quickstart guide here https://kotlinlang.org/docs/ksp-quickstart.html but when I sync gradle I get a significant amount of errors. Am I doing something wrong?
Main error:
Copy code
org.gradle.internal.exceptions.LocationAwareException: Build file '/Users/zach.calman/Projects/step-out-android/build.gradle.kts' line: 2
Plugin [id: 'com.android.application', version: '7.2.2', apply: false] was not found in any of the following sources:
t
android plugins are loaded from Google maven repo:
google()
in Gradle
z
I am loading my plugins with the google() maven repo
I followed the playground example, here is what my settings.gradle looks like (mostly)
Copy code
pluginManagement {
    val kspVersion: String by settings
    val kotlinVersion: String by settings

    plugins {
        id("org.jetbrains.kotlin.android") version kotlinVersion apply false
        id("com.google.devtools.ksp") version kspVersion
        kotlin("jvm") version kotlinVersion
    }
    repositories {
        gradlePluginPortal()
        google()
        mavenCentral()
    }
}
I am still unable to use add
kotlin("jvm")
to any modules or use
ksp()
dependencies
Okay, I was able to resolve it by adding the plugin
com.google.devtools.ksp
to my module-level build.gradle.
kotlin("jvm")
was not required.
v
The
pluginManagement { plugins { ... } }
block just defines default versions for plugins if they are used in the build.
apply false
there is useless.
z
Good to know, thanks
104 Views