ksp: Bug: ClassNotFoundException, but it does exist in the project
Hello there, I am trying to read my annotation using
classDeclaration.getAnnotationsByType(ActivityReference::class).first()
and getting this error
Caused by: com.google.devtools.ksp.KSTypeNotPresentException: java.lang.ClassNotFoundException: com.veepee.vpcore.route.BarImpl
This is a bit odd since the full qualified name in the exception seems to correct.
I tried this, but I still got the same error.
A project to reproduce it is attached here
To my specific needs I don’t need to instantiate the annotation, but to get the String with the qualified name for ActivityReference.activityName
, would it be possible with KSP ?
About this issue
- Original URL
- State: open
- Created 2 years ago
- Comments: 19
This is a deprecated answer and a better way for this issue: https://github.com/google/ksp/issues/1038#issuecomment-1958577350
Me too, but I found that I could get the corresponding class qualifiedName from the Exception, howerve It’s not a perfect solution;
KSTypeNotPresentException is thrown from here
Me too, I just need to class name, I think this is super odd, because the ClassNotFoundException message that we receive contains the class name.
@JailedBird Great explanation, thank you! At least this work around helped me!
personally, i don’t need to access the object, I just need to be able yoink the fully qualified name, but the processor errors out when trying to access any information of the class