e: [ksp] No providers found in processor classpath.

I looked online, Asked GPT, Web asked GPT and nothing I found explained me the error in my case. I even tried manually defining it. ./gradlew clean build
Task :annotation-proccessor:kspKotlin FAILED
e: [ksp] No providers found in processor classpath.
package de.hype.bingonet.compilation.processors

import com.google.auto.service.AutoService
import com.google.devtools.ksp.processing.SymbolProcessor
import com.google.devtools.ksp.processing.SymbolProcessorEnvironment
import com.google.devtools.ksp.processing.SymbolProcessorProvider

@AutoService(SymbolProcessorProvider::class)
class ModalComponentProcessorProvider : SymbolProcessorProvider {
override fun create(environment: SymbolProcessorEnvironment): SymbolProcessor {
return ModalComponentProcessor(environment)
}
}
package de.hype.bingonet.compilation.processors

import com.google.auto.service.AutoService
import com.google.devtools.ksp.processing.SymbolProcessor
import com.google.devtools.ksp.processing.SymbolProcessorEnvironment
import com.google.devtools.ksp.processing.SymbolProcessorProvider

@AutoService(SymbolProcessorProvider::class)
class ModalComponentProcessorProvider : SymbolProcessorProvider {
override fun create(environment: SymbolProcessorEnvironment): SymbolProcessor {
return ModalComponentProcessor(environment)
}
}
32 Replies
JavaBot
JavaBot4mo ago
This post has been reserved for your question.
Hey @Hype_the_Time (PING ON REPLY)! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
dan1st
dan1st4mo ago
You have ksp("com.google.auto.service:auto-service:latest.release") Can you try replacing it with kapt("com.google.auto.service:auto-service:latest.release")? IIRC Google AutoService is an annotation processor and not a KSP thing The purpose of that project is writing a symbol processor for KSP, right? Then I don't think you need to use KSP on your symbol processor
Hype_the_Time (PING ON REPLY)
seems to work. still got errors but those are bad impelemtations from me i assume. it tries to generate stuff it looks. ty @dan1st | Daniel i use annotation processing → ksp to generate registration code. problem rn is that if i want to run my code in the local test setup i wrote it is not including the main sources during generation or something. due to this my lists for registrations are generated empty. how can i let ksp include the main src during test compilation?
dan1st
dan1st4mo ago
Don't. Create one module containing the symbol processor and create another module that uses it
Hype_the_Time (PING ON REPLY)
oh yeah doing that
dan1st
dan1st4mo ago
don't cause yourself unnecessary pain
Hype_the_Time (PING ON REPLY)
itsd already sperated into seperate but that issue with registration remains. its not processign ym normal main code if i run it in test
Hype_the_Time (PING ON REPLY)
wait i cutted to far
No description
dan1st
dan1st4mo ago
idk what you mean with running it in tests but I'm not reading code in screenshots and if you are configuring it to process test code, it shouldn't process non-test code
Hype_the_Time (PING ON REPLY)
the system is made to be ran on a server. the way i run it locally uses the test sources. i write custom test functions there too etc. if i run the setup tho the processor does not process the annotations that are normal. i would expect it to proccess resources from both normal and test src.
dan1st
dan1st4mo ago
Show me how exactly you set it up and what exactly is not processed but if you want it to process main and test sources, you should set it up as a processor for main sources I think
Hype_the_Time (PING ON REPLY)
in the scs i sent you can ssee the test one having empty lists while the other has them populated. each one of the registries stands for a class in main that is annotated. essentially test one is empty cus nothing in main gets processed
dan1st
dan1st4mo ago
I'm not gonna read text in dark theme screenshots and what exactly is not processed there and how do you see it?
Hype_the_Time (PING ON REPLY)
anything form nomral. like src/main essentially its probably only processing src/test
dan1st
dan1st4mo ago
So main/src/test/kotlin is processed but main/src/main/kotlin isn't? Did you verify that? Did you attach a debugger to the processing? How do you see what is processed and what isn't?
Hype_the_Time (PING ON REPLY)
let copy a class over
dan1st
dan1st4mo ago
?
Hype_the_Time (PING ON REPLY)
proofed it. i copied 1 class that is annotated over to test. it appears in the registry all ones from main dont
dan1st
dan1st4mo ago
What do you mean with copying a class? and what do you mean with appearing in the registry? Just attach a debugger to the build and see what is processed?
Hype_the_Time (PING ON REPLY)
the class gets generated but with no entries in test while its fully populated in main. test had nothinbg in it but it also had no class with the annotation. so i went in copied a class from main just to see whether it would work if its in test. and it worked then. but only the copied class.
dan1st
dan1st4mo ago
Did you attach a debugger to the compilation/processing?
Hype_the_Time (PING ON REPLY)
no clue on how you want me to test it. tried a bunch of stuff but no results at all
dan1st
dan1st4mo ago
add the CLI arguments to attach a debugger to Gradle?
Hype_the_Time (PING ON REPLY)
wait results resolver.getSymbolsWithAnnotation(DiscordSingleCommandImplementation::class.qualifiedName!!).toList() is returning empty list while in the first one it is size 14 means resolver is def not including them i assume
dan1st
dan1st4mo ago
and where are the annotated classes?
Hype_the_Time (PING ON REPLY)
main src example path: ~/IdeaProjects/BingoNet-Server/main/src/main/kotlin/de/hype/bingonet/server/discord/events/staticimplementations/commands/commands/development/TestDiscordCommand.kt
dan1st
dan1st4mo ago
What exactly is resolver?
Hype_the_Time (PING ON REPLY)
google copy right stuff here
package com.google.devtools.ksp.processing

import com.google.devtools.ksp.symbol.KSAnnotated

/**
* [SymbolProcessor] is the interface used by plugins to integrate into Kotlin Symbol Processing.
* SymbolProcessor supports multiple rounds of execution, a processor may return a list of deferred symbols at the end
* of every round, which will be passed to processors again in the next round, together with the newly generated symbols.
* On exceptions, KSP will try to distinguish between exceptions from KSP and exceptions from processors.
* Exceptions from processors will immediately terminate processing and be logged as an error in KSPLogger.
* Exceptions from KSP should be reported to KSP developers for further investigation.
* At the end of the round where exceptions or errors happened, all processors will invoke onError() function to do
* their own error handling.
*/
interface SymbolProcessor {
/**
* Called by Kotlin Symbol Processing to run the processing task.
*
* @param resolver provides [SymbolProcessor] with access to compiler details such as Symbols.
* @return A list of deferred symbols that the processor can't process. Only symbols that can't be processed at this round should be returned. Symbols in compiled code (libraries) are always valid and are ignored if returned in the deferral list.
*/
fun process(resolver: Resolver): List<KSAnnotated>

/**
* Called by Kotlin Symbol Processing to finalize the processing of a compilation.
*/
fun finish() {}

/**
* Called by Kotlin Symbol Processing to handle errors after a round of processing.
*/
fun onError() {}
}
package com.google.devtools.ksp.processing

import com.google.devtools.ksp.symbol.KSAnnotated

/**
* [SymbolProcessor] is the interface used by plugins to integrate into Kotlin Symbol Processing.
* SymbolProcessor supports multiple rounds of execution, a processor may return a list of deferred symbols at the end
* of every round, which will be passed to processors again in the next round, together with the newly generated symbols.
* On exceptions, KSP will try to distinguish between exceptions from KSP and exceptions from processors.
* Exceptions from processors will immediately terminate processing and be logged as an error in KSPLogger.
* Exceptions from KSP should be reported to KSP developers for further investigation.
* At the end of the round where exceptions or errors happened, all processors will invoke onError() function to do
* their own error handling.
*/
interface SymbolProcessor {
/**
* Called by Kotlin Symbol Processing to run the processing task.
*
* @param resolver provides [SymbolProcessor] with access to compiler details such as Symbols.
* @return A list of deferred symbols that the processor can't process. Only symbols that can't be processed at this round should be returned. Symbols in compiled code (libraries) are always valid and are ignored if returned in the deferral list.
*/
fun process(resolver: Resolver): List<KSAnnotated>

/**
* Called by Kotlin Symbol Processing to finalize the processing of a compilation.
*/
fun finish() {}

/**
* Called by Kotlin Symbol Processing to handle errors after a round of processing.
*/
fun onError() {}
}
think i got it to run.

Did you find this page helpful?