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

Support Kotlin 2.1.0 #4451

Open
ZacSweers opened this issue Sep 23, 2024 · 2 comments
Open

Support Kotlin 2.1.0 #4451

ZacSweers opened this issue Sep 23, 2024 · 2 comments

Comments

@ZacSweers
Copy link

ZacSweers commented Sep 23, 2024

When testing dagger with K2 Kapt on Kotlin 2.1.0-Beta1, it fails with the below trace.

Repro

Trace

Caused by: java.lang.IllegalStateException: Unable to read Kotlin metadata due to unsupported metadata version.	
	at dagger.internal.codegen.kotlin.KotlinMetadata.metadataOf(KotlinMetadata.java:180)	
	at dagger.internal.codegen.kotlin.KotlinMetadata.from(KotlinMetadata.java:157)	
	at dagger.internal.codegen.kotlin.KotlinMetadataFactory.create(KotlinMetadataFactory.java:55)	
	at dagger.internal.codegen.kotlin.KotlinMetadataUtil.getAllMethodNamesBySignature(KotlinMetadataUtil.java:89)	
	at dagger.internal.codegen.validation.ComponentValidator$ElementValidator.validateClassMethodName(ComponentValidator.java:256)	
	at dagger.internal.codegen.validation.ComponentValidator$ElementValidator.validateComponentMethods(ComponentValidator.java:247)	
	at dagger.internal.codegen.validation.ComponentValidator$ElementValidator.validateElement(ComponentValidator.java:176)	
	at dagger.internal.codegen.validation.ComponentValidator.validateUncached(ComponentValidator.java:136)	
	at dagger.internal.codegen.base.Util.reentrantComputeIfAbsent(Util.java:33)	
	at dagger.internal.codegen.validation.ComponentValidator.validate(ComponentValidator.java:132)	
	at dagger.internal.codegen.processingstep.ComponentProcessingStep.isComponentValid(ComponentProcessingStep.java:149)	
	at dagger.internal.codegen.processingstep.ComponentProcessingStep.processRootComponent(ComponentProcessingStep.java:98)	
	at dagger.internal.codegen.processingstep.ComponentProcessingStep.process(ComponentProcessingStep.java:87)	
	at dagger.internal.codegen.processingstep.ComponentProcessingStep.process(ComponentProcessingStep.java:49)	
	at dagger.internal.codegen.processingstep.TypeCheckingProcessingStep.lambda$process$0(TypeCheckingProcessingStep.java:94)	
	at com.google.common.collect.RegularImmutableMap.forEach(RegularImmutableMap.java:297)	
	at dagger.internal.codegen.processingstep.TypeCheckingProcessingStep.process(TypeCheckingProcessingStep.java:72)	
	at dagger.internal.codegen.processingstep.TypeCheckingProcessingStep.process(TypeCheckingProcessingStep.java:49)	
	at dagger.spi.internal.shaded.androidx.room.compiler.processing.XProcessingStep.process(XProcessingStep.kt:57)	
	at dagger.spi.internal.shaded.androidx.room.compiler.processing.CommonProcessorDelegate.processRound(XBasicAnnotationProcessor.kt:134)	
	at dagger.spi.internal.shaded.androidx.room.compiler.processing.javac.JavacBasicAnnotationProcessor.process(JavacBasicAnnotationProcessor.kt:75)	
	at org.jetbrains.kotlin.kapt3.base.incremental.IncrementalProcessor.process(incrementalProcessors.kt:90)
@bcorso
Copy link

bcorso commented Sep 23, 2024

I think this should have been fixed by #4211 (comment) but you'll need to use the HEAD-SNAPSHOTS until the next official release.

@ZacSweers
Copy link
Author

quick edit - not specific to K2 kapt, this is just a general need for an updated release with newer kotlin-metadata

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

2 participants