Showkase
Showkase copied to clipboard
ShowkaseModuleCodegen not regenerated nor updated when preview components are removed.
Prerequisite:
- Add a
Foo
and aFooPreview
composable accordingly, withFooPreview
as a preview function forFoo
. - Build the project
Scenario:
- Remove
FooPreview
function.
Actual Result:
- Project will not compile since
ShowkaseModuleCodegen
is still looking and referencing forFooPreview
.
Expected Result:
-
ShowkaseModuleCodegen
should be regenerated or updated since a preview component was removed from the codebase.
Workaround: Clean / Rebuild the app
I'm guessing you are using kapt and not ksp? @crjacinro
Yes. Kapt.
I'm having a similar issue as well, using kapt. I am not sure if there's caching happening, but for me even cleaning and rebuilding the app, or Invalidating caches and restarting AS does not solve the issue... ShowkaseModuleCodegen
continues to somehow reference the removed previews, even after I removed all references completely from my code, so I am not sure just how it's still referencing code that no longer exists.
It's a pretty blocking issue which I am surprised why it's not raised often.
I am running the latest 1.0.0-beta15
.
I'm having a similar issue as well, using kapt. I am not sure if there's caching happening, but for me even cleaning and rebuilding the app, or Invalidating caches and restarting AS does not solve the issue...
ShowkaseModuleCodegen
continues to somehow reference the removed previews, even after I removed all references completely from my code, so I am not sure just how it's still referencing code that no longer exists.It's a pretty blocking issue which I am surprised why it's not raised often.
I am running the latest
1.0.0-beta15
.
Also seeing this
@trod-123 have you found a workaround with this?
@je-ramos-acc I went with using ksp instead of kapt, which has been working great so far after numerous iterations on my end.
@je-ramos-acc Update the name in @Preview make it regenerate for me:
@Preview(name= "Change to specific name")
Updated: No, it not work :(
Having the same problem, I would appreciate some help on this, I realise you are suggesting moving to ksp would solve the issue but commercial project realities prevent me from doing that atm. Is there any way to force regeneration of code for kapt?
The only way to force regeneration in my experience has been to just make some manual changes to the generated root file. That causes it to run again. I think the only real solution is using ksp as that's been working really well so far.
I'm open to ideas though.
I've also had trouble with this recently, and Showkase is also integrated with kapt
in the app I work on. My workaround has been as follows:
- run
clean
for any module that is providing components I want to see in the browser - run a build with --no-build-cache
@vinaygaba, it sounds like you're not currently sure why ksp
is picking up the changes and kapt
does not?
The only way to force regeneration in my experience has been to just make some manual changes to the generated root file. That causes it to run again.
To me, this makes it sound like a gradle task input or output is improperly declared, but Showkase obviously doens't provide it's own tasks, it just hooks into kapt
... 🤔
It all sounds very similar to this old issue for Kapt version 1.3, but I've only noticed this particular problem with Showkase and not other annotation processors. Definitely a tricky problem
voting this up. The issue is still there and is quite painful when switching between branches. Any plans to fix this?