evanchooly
06/03/2024, 11:45 PMERROR CLASS: Symbol not found for Entity
I have this code:
val annotations = klass.annotations.toList()
and in that list, the count is correct but if I try to extract out info I get null:
it.annotationType.resolve().declaration.qualifiedName?.asString()
that declaration
returns a KSErrorTypeClassDeclaration
. It seems like ksp can't find the classdef for that type but it's definitely on my test's classpath. any idea what's going wrong?evanchooly
06/03/2024, 11:45 PMklass
is a KSClassDeclaration
Ting-Yuan Huang
06/03/2024, 11:47 PMksp.useKSP2=true
? If not, is this a MPP project?evanchooly
06/03/2024, 11:47 PMevanchooly
06/03/2024, 11:47 PMKspJvmMain.kt
approachTing-Yuan Huang
06/03/2024, 11:55 PMKSPConfig.libraries
?
If the annotation class is defined in yet-to-be-compiled Java sources, a common pitfall is directories not matching package name. It also has to be within the same compilation unit, instead of libraries (if not compiled yet).evanchooly
06/03/2024, 11:59 PMsrc/main
but i'm running my processor from src/test
so let me try and clean that up a little bit. this should all (mostly) be in src/main
anywayevanchooly
06/04/2024, 12:38 AMevanchooly
06/04/2024, 12:52 AMevanchooly
06/04/2024, 12:54 AMTing-Yuan Huang
06/04/2024, 12:55 AMKSPConfig.libraries
?evanchooly
06/04/2024, 12:55 AMevanchooly
06/04/2024, 12:55 AMevanchooly
06/04/2024, 12:56 AMTing-Yuan Huang
06/04/2024, 12:56 AMevanchooly
06/04/2024, 12:58 AMevanchooly
06/04/2024, 12:59 AMTing-Yuan Huang
06/04/2024, 1:00 AM