You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> Task :logic:kspDebugAndroidTestKotlinAndroid FAILED
e: [ksp] java.lang.IllegalStateException: Required value was null.
at com.squareup.kotlinpoet.ksp.UtilsKt.toClassNameInternal(utils.kt:63)
at com.squareup.kotlinpoet.ksp.KsClassDeclarationsKt.toClassName(KsClassDeclarations.kt:23)
at io.mockative.ProcessableType$Companion.fromDeclaration(ProcessableType.kt:82)
at io.mockative.ProcessableType$Companion.fromResolver(ProcessableType.kt:143)
at io.mockative.MockativeSymbolProcessor.process(MockativeSymbolProcessor.kt:25)
at com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension$doAnalysis$8$1.invoke(KotlinSymbolProcessingExtension.kt:310)
at com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension$doAnalysis$8$1.invoke(KotlinSymbolProcessingExtension.kt:308)
at com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension.handleException(KotlinSymbolProcessingExtension.kt:414)
at com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension.doAnalysis(KotlinSymbolProcessingExtension.kt:308)
I am trying to get more information about it. I'm not sure what is the edge case I'm falling into at the moment, as it doesn't seem to have affected Mockative's :shared:kspDebugAndroidTestKotlinAndroid for example.
Findings
I copied mockative-processor into the project and ran it from local source + attached a debugger to it.
I see some class is KSErrorTypeClassDeclaration when calling fromDeclaration:
After more debugging, I found out:
I was solving conflicts during the Mockative 2.x upgrade and had a missing import in an Android-specific test.
There was no message that could lead me to the correct place and I really had to attach a debugger to check it out.
TL;DR:
We could improve error handling and provide more helpful error messages during KSP compiling. Maybe just spitting out a Failure during processing of property 'propertyName' in file 'path/to'file' would be helpful enough.
The text was updated successfully, but these errors were encountered:
vitorhugods
changed the title
Failure to get class name during code generation on some Android source sets
Unclear error messages in Mockative KSP processor
Apr 16, 2024
Starting on Mockative
2.2.0
, I'm facing this issue when runningkspDebugAndroidTestKotlinAndroid
(here's the codebase I'm running it on).I am trying to get more information about it. I'm not sure what is the edge case I'm falling into at the moment, as it doesn't seem to have affected Mockative's
:shared:kspDebugAndroidTestKotlinAndroid
for example.Findings
I copied
mockative-processor
into the project and ran it from local source + attached a debugger to it.I see some class is
KSErrorTypeClassDeclaration
when callingfromDeclaration
:After more debugging, I found out:
I was solving conflicts during the Mockative 2.x upgrade and had a missing import in an Android-specific test.
There was no message that could lead me to the correct place and I really had to attach a debugger to check it out.
TL;DR:
We could improve error handling and provide more helpful error messages during KSP compiling. Maybe just spitting out a
Failure during processing of property 'propertyName' in file 'path/to'file'
would be helpful enough.The text was updated successfully, but these errors were encountered: