Showkase
Showkase copied to clipboard
Multiple styles for component processor error
When compiling, almost 1 times out of 2, I get the following error:
com.airbnb.android.showkase.processor.exceptions.ShowkaseProcessorException: Multiple styles for component: Button are current set as default style. Only one style is allowed to be the default style
I only have 1 @ShowkaseComposable
with the defaultStyle = true
.
One possible way to fix is to not used defaultStyle
, but then the generated class (extending ShowkaseProvider
) has duplicates in componentList
.
I guess something is wrong with the processor's cache
@badoualy Have you tried Showkase with ksp? Did that happen even with the ksp version?
@badoualy Checking again to see if you are also observing this with ksp?
I'm using kapt (ksp is a big jump for us to bring everything over to) and experiencing this issue. So I can't say if this is specific to kapt but I would question the wisdom of telling everyone to perform a complicated migration to KSP in order to keep Showkase from breaking every other build. We spend a lot of time re-running pipelines (and local builds) because of this error.
Hey @chanakin, no where on this thread am I suggesting you to migrate to ksp. I was only asking if this was something you observed with ksp (if you happen to use that already) as it would help me troubleshoot the issue better. The reason this question is relevant is because kapt has some issues with incremental compilation that caused some flakiness in my experience. If this issue was somehow due to that, I have little-to-no control over it as it's a kapt bug. If this issue was also happening in ksp, there was a strong chance that it's probably due to a bug in the library and I would spend more time investigating it.
Hey @vinaygaba I understand, and unfortunately do not have any insight into whether this issue occurs with ksp, as we do not use ksp.
I am using kapt and have the same problem.
I think it has something to do with #273 and #193. It seems that there is a case where the default style
created before is not deleted, but it is added to it and judged as two.
I am also running into this on kapt. It seems the only solution is to not use defaultStyle
. I tried to see if specifying defaultStyle on each preview would help but it did not.