Skip to content
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

Feature request: Add support for K2 compiler. #4211

Open
lubo-pisk opened this issue Jan 12, 2024 · 2 comments
Open

Feature request: Add support for K2 compiler. #4211

lubo-pisk opened this issue Jan 12, 2024 · 2 comments

Comments

@lubo-pisk
Copy link

lubo-pisk commented Jan 12, 2024

I have following configuration:

K2 Compiler
Kotlin 2.0.0-Beta1
Dagger 2.50

kotlin.experimental.tryK2=true
kapt.use.k2=true

Build failed with error:

error: annotation @SuppressLint is missing a default value for the element 'value'

Only Dagger uses kapt in my project.

Build is ok when kapt.use.k2=false.

@bcorso
Copy link

bcorso commented Jan 12, 2024

Do you have an example where this @SuppressLint usage is coming from?

I don't think Dagger uses @SuppressLint anywhere in our API or generated code, so it's unclear what we could do to fix this on our side.

@dniHze
Copy link

dniHze commented Apr 15, 2024

We don't see the same problem in our codebase. However, Dagger uses kotlinx-metadata to process Kotlin code in the kapt processor. In our project, compiling it with K2 KAPT enabled will produce NullPointer exception there. As Kotlin 2.0.0 comes with a new stable artifact for metadata processing, which makes it incompatible with the metadata generated with the K2/kapt. Resolving this requires an update to the newer artifact. I'm not so sure if the newer artifact will be backward compatible with K1-produced code though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants