https://kotlinlang.org logo
Join Slack
Powered by
# ksp
  • j

    JP Sugarbroad

    09/26/2025, 11:57 PM
    Copy code
    > Task :redacted:kspKotlin FAILED
    e: [ksp] Unknown error processing element
    e: [ksp] io.micronaut.inject.processing.ProcessingException
    I don't suppose there's more detail than this? Maybe a stack trace?
    m
    • 2
    • 12
  • a

    atlantis210

    09/30/2025, 5:38 AM
    Hey, did any of you did succeed in generating code in a KMM commonTest module ? I tried to search on this channel, but nothing did the trick for me
    g
    • 2
    • 1
  • u

    ursus

    10/07/2025, 5:38 PM
    I'm a complete codegen noob, but can someone explain to me - if I have codegen that generates new types & I reference the generated types - how can that build at all after say a fresh git clone? Isn't that a chicken & egg problem?
    r
    j
    +2
    • 5
    • 20
  • m

    Maya

    10/08/2025, 8:03 PM
    Hi all, KSP version 2.0.4 has been released and includes the following changes and bug fixes: • Unable to build on AGP 8.11.1 using KSP 2.2.20-2.0.3 due to class cast exception #2614 • Resolver#getJvmCheckedException(KSPropertyAccessor) throws IllegalArgumentException #2548 • ClassCastException when building with 2.2.20-2.0.3 #2598 • Replace KaFirStopWorldCacheCleaner with no-op implementation #2626 • BuildConfig values are not available during annotation process after upgrading ksp from 2.2.10-2.0.2 -> 2.2.20-2.0.3 #2597 • Missing Gradle task wiring with 2.2.20-2.0.3 #2595 • 2.2.20-2.0.3 + protobufJavalite build errors #2596 To view all released versions of KSP, visit https://github.com/google/ksp/releases. Thanks! The KSP Team
    🎉 10
  • r

    Robert Jaros

    10/10/2025, 4:49 AM
    Hi, any chance for 2.3.0-Beta1 compatible release before the weekend?
    z
    h
    • 3
    • 3
  • e

    ebtokyo

    10/14/2025, 6:18 AM
    Hi, I wonder if this issue could get some attention, the only reason we didn't merge ksp 2.2.20.x is because it produce additional 3500 lines of warning in our build, because we can't update yet to KSP2 : https://github.com/google/ksp/issues/2635
  • z

    Zac Sweers

    10/22/2025, 2:33 AM
    getting a bunch of renovate updates for 2.3.0 but not seeing any release. I know I harped on this before but want to knock on this again 🙂. Slightly different in this case, but same end problem https://kotlinlang.slack.com/archives/C013BA8EQSE/p1689880945169069
    ➕ 5
    j
    j
    t
    • 4
    • 4
  • m

    Maya

    10/22/2025, 5:10 PM
    Hi all, KSP version 2.3.0 has been released and includes the following changes and bug fixes: • KSP1 has been deprecated #2657 • KSP is now independent of Kotlin Versions #2658 To view all released versions of KSP, visit https://github.com/google/ksp/releases. Thanks, The KSP Team
    K 6
    🎉 8
    t
    j
    • 3
    • 2
  • e

    eygraber

    10/22/2025, 5:58 PM
    I closed this issue with klib cross compilation, thinking it was just an issue with KSP1, but it is still an issue with KSP 2.3.0. The KGP API for determining the state of cross compilation is currently targeted for Kotlin 2.3.20, but as of Kotlin 2.2.20 cross compilation is enabled by default. Does it make sense to flip the check in KSP to enable the task unless
    kotlin.native.enableKlibsCrossCompilation == false
    ?
  • j

    jamireh

    10/24/2025, 8:55 PM
    👋 Could I get a review/direction on https://github.com/google/ksp/pull/2665? This is blocking us from upgrading to KSP 2.3.0
    t
    • 2
    • 2
  • s

    Swati Bajaj

    10/29/2025, 10:31 AM
    2.2.21-2.0.4 is it a stable KSP version?
    🎉 1
    thank you color 1
    👌 2
    👍 2
  • s

    Swati Bajaj

    10/29/2025, 3:30 PM
    When i changed my KSP version from 2.2.20-2.0.4 to 2.2.21-2.0.4, there is a significant increase in jenkins build time (2-3 mins approx). Do we know why? Or any body else facing a similar issue?
  • j

    jamireh

    10/30/2025, 12:13 AM
    What's more recent: 2.2.21-2.0.4 or 2.3.0? This is quite a confusing version scheme now
    j
    t
    • 3
    • 6
  • r

    Rey (Kingg22)

    11/01/2025, 6:13 PM
    Hello 👋 Does anyone have a library or configuration for testing their processor in multi-platform environments? I am using androidx room compiler testing to test my processor. It works well and I have no problems, but it only works as jvm code and I would like to add tests for certain annotations that are only for multi-platform KMP
    j
    • 2
    • 1
  • m

    Maya

    11/04/2025, 8:39 PM
    Hi all, KSP version 2.3.1 has been released and includes the following changes and bug fixes: • Added support for AGP 9.0 and built-in Kotlin #2674 • Fixed a bug in getJvmCheckedException that incorrectly handled nested classes. #2584 • Removed incorrect caching for KSValueArgumentLiteImpl that wrongly merged arguments with different parents, origins, or locations #2677 To view all released versions of KSP, visit https://github.com/google/ksp/releases.
    ❤️ 2
  • a

    arnaud.giuliani

    11/05/2025, 4:36 PM
    Hello all 👋 we observed problem since KSP2, for scanning annotations in KMP multi modules app. The Koin Annotations project uses
    Resolver.getDeclarationsFromPackage()
    to scan annotations from other modules. It works in KSP 2.3.1 & Android apps (multi modules). For KMP apps, it stops working since 2.1.20-1.0.31 & KSP1. When switching to KSP2, other modules' annotations are not seen from the commonMain task. Seems to appear in the android detected element, where it should not (I'm scanning an element declared in commonMain generation). This project uses KSP. The
    data
    module should allow to scan external module and associate them. The Data Module is not detected since KSP2 version. I opened the issue => https://github.com/google/ksp/issues/2695 (sample project attached) Let me know if it's a config problem. Any help is appreciated 🙂 🙏
    👀 1
    • 1
    • 1
  • r

    rocketraman

    11/05/2025, 5:18 PM
    I have a project that includes two KSP processors. One KSP processor contributes code that contains annotations that are used by the second KSP processor, OSS project Zodable (https://github.com/guimauvedigital/zodable/tree/main/zodable-ksp-processor). In debugging this, I see that the Zodable processor is called twice -- once with the original set of annotated classes, then again with the new generated set of annotated classes from the first processor. The Zodable processor writes some stuff to disk, but it currently assumes it is only called once, so the second execution of it borks the output. What would the right way to fix this in the Zodable processor be? I thought about appending to those outputs but that doesn't work for incremental builds where the outputs already exist.
    • 1
    • 2
  • m

    Maya

    11/06/2025, 8:31 PM
    Hi all, KSP version 2.3.2 has been released.This release is a hotfix for a regression introduced in version 2.3.1 and includes the following bug fixes: • Fixed an issue where KSP incorrectly processed specific nullable annotations from Java interfaces, leading to incorrect nullability in the generated Kotlin code #2696 • Fixed a regression introduced in #2656 that caused runtime failures for projects using AGP 8.8.0 and older due to an incompatible, version-specific type check. #2694 To view all released versions of KSP, visit https://github.com/google/ksp/releases.
  • r

    Rey (Kingg22)

    11/06/2025, 10:13 PM
    Hii, I would like to know if ksp has forward compatibility, since the API rarely changes, or if only backward compatibility is maintained?
  • z

    Zac Sweers

    11/10/2025, 6:41 PM
    when working with KMP, the docs suggest to apply the KSP processors you need to both common and the specific targets: https://kotlinlang.org/docs/ksp-multiplatform.html
    Copy code
    dependencies {
        add("kspCommonMainMetadata", project(":test-processor"))
        add("kspJvm", project(":test-processor"))
    }
    However, I'm finding this to have a couple problems 1. The
    kspCommonMainMetadata
    task never appears to run unless explicitly depended on. This has been pointed out in the issue tracker it seems: https://github.com/google/ksp/issues/567#issuecomment-2609469736 2. It appears that processors in specific targets run on all sources (the complete set of target and common sources), which results in redeclaration/duplication issues for any sources in
    commonMain
    . My questions on this I guess are • Should
    kspCommonMainMetadata
    be configured to always run? Or at least if it has processors on its classpath? Seems a longstanding footgun that it's inert by default without some manual gradle fiddling • Should there be a way to limit processing in specific targets to only run on sources defined in that source set, rather than the full set? I don't see a means currently for processors to handle this scenario (no means of detecting source set of origin, etc) In general, it appears strongly to me like KSP on common sources is essentially only viable if you don't use the same processors in multiple source sets and know how to do the above gradle task wiring trick to force it to run. Happy to file issues for each of the above bullets too
    plus one 6
    r
    e
    +3
    • 6
    • 21
  • z

    zsmb

    11/10/2025, 7:53 PM
    Tagging onto the above, I would really, really love something that makes it easier to set up KSP processors in Gradle config for users. Compared to the old
    ksp("coordinates-go-here")
    solution, the new way of several declarations, per source set, all stringly typed is very tedious and error-prone 😞 I think it would be a safe assumption, at least by default, that I want to apply KSP to all platforms I have set up? I assume there are stats about the most used processors, it would be great to take a look at what their normal setup code looks like and if something could be done to simplify this for the happy path at least.
    ➕ 4
    e
    t
    m
    • 4
    • 4
  • f

    Francisco Barreiras

    11/11/2025, 12:00 AM
    Hello, Is it it possible to use ksp-api with kotlin/js? Basically I have a project with the app (js app) and kspcore (annotation processor), both are kotlin/js submodules and I'm trying to use the ksp api in kspcore, could I get some help?
    z
    • 2
    • 2
  • v

    vishnurajeevan

    11/12/2025, 4:49 PM
    https://github.com/google/ksp/issues/2275 i'm still seeing this issue with ksp 2.3.2 and room 2.8.3 on the following property:
    Copy code
    @ColumnInfo(name = "is_working")
        var isWorking: Boolean? = null
    • 1
    • 1
  • f

    Francisco Barreiras

    11/12/2025, 9:44 PM
    Hello, I have a ksp module and I want to use a processor to generate methods used by kotlin/js module. The main struggle is that I want the generated methods to use a javascript specific method (specifically the js function which runs js code). This is similar to the JSPlainObject compiler plugin. Is this possible? If so how?
    r
    • 2
    • 1
  • k

    Konstantin

    11/16/2025, 12:45 PM
    Please check out new KSP maven plugin. It’s using KSP 2.3.2 under the hood. Would be great to hear your feedback
    👀 1
    👍 1
    • 1
    • 1
  • d

    dead.fish

    11/18/2025, 8:56 AM
    I recently updated KSP to 2.3.2 and experience a drop in Kover code coverage on @Serializable data classes, anybody else stumbled upon this? When I look at the Kover report, lines like
    Copy code
    @SerialName("foo")
    val foo: String
    are only covering the annotation, but not the property declaration.
  • j

    Javier

    11/21/2025, 12:47 PM
    Hello! Is there any workaround to force KSP to get a class generated by a compiler plugin in FIR?
    m
    e
    • 3
    • 9
  • m

    Maya

    11/21/2025, 5:40 PM
    Hi all, KSP version 2.3.3 has been released and includes the following changes and bug fixes: • Migrate away from a deprecated compilerOptions KGP API #2703. To view all released versions of KSP, visit https://github.com/google/ksp/releases.
    🎉 4
  • m

    Marcel

    11/27/2025, 8:52 PM
    Would you be interested in a PR with a ksp-maven-plugin which you would take over as an official maven plugin? We currently have (at least) two inofficial ksp-maven-plugins ( https://github.com/mcarleio/ksp-maven-plugin and https://github.com/kpavlov/ksp-maven-plugin) but still lack an official one. I think it would be valueable for KSP. And the amount of extra code to maintain is also not very high. If you are interested, I would try to join forces with @Konstantin and create a PR.
    yes black 1
    k
    • 2
    • 3
  • k

    Konstantin

    11/28/2025, 4:44 AM
    Does anywone know if the multiple KSP runs issue might be fixed on KSP side anytime soon?