-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KSP compiler warning when using multi preview annotations #322
Comments
@JeremiahStephenson Is this only happening in the multi preview context? i.e can you confirm you aren't seeing this when you are not using multi-preview? |
I'm also experiencing something similar, but it is not related to the root module, not multiple annotations:
|
@vinaygaba I can confirm that this happens with custom annotation classes. My annotations look like this: import androidx.compose.ui.tooling.preview.Preview
@Preview(widthDp = 411, heightDp = 842)
annotation class PortraitPreview
@Preview(widthDp = 842, heightDp = 411)
annotation class LandscapePreview
@PortraitPreview
@LandscapePreview
annotation class OrientedPreviews When I use
If I replace |
Yes, the issue seems to come from that generated metadata used to be able to automatically detect multi preview annotations in KSP through different runs in different modules. I modified the code in Showkase to only process annotations provided with You can see my changes here, in case they help. |
@matejdro Did you have any luck resolving this issue coming from the RootModuleCodegen? Currently experiencing the same warning/issue causing our custom Jenkins job to fail |
No luck yet, but the warning does not seem to affect anything. Our jobs do not fail because of it. |
This has been fixed with the following change - #383 |
When using ksp combined with multi preview annotations I am seeing a compiler warning like this:
The custom annotation looks like this:
What I think is happening is that KSP is picking up on the @Preview annotation over the custom annotation (like it would normally do for a compose preview) and generates a file based on it. But then something checks it later and realizes something is wrong since the generated code isn't tied to an actual preview.
The text was updated successfully, but these errors were encountered: