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

when adding module annotation and build project error shown #2845

Closed
michaelsam94 opened this issue Sep 7, 2021 · 2 comments
Closed

when adding module annotation and build project error shown #2845

michaelsam94 opened this issue Sep 7, 2021 · 2 comments

Comments

@michaelsam94
Copy link

`Execution failed for task ':app:kaptDebugKotlin'.

A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptWithoutKotlincTask$KaptExecutionWorkAction
java.lang.reflect.InvocationTargetException (no error message)

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --scan to get full insights.`
@michaelsam94
Copy link
Author

michaelsam94 commented Sep 7, 2021

I create repo showing the error

@danysantiago
Copy link
Member

danysantiago commented Sep 7, 2021

That error is usually an indicator that the annotation processor crashed, to see the full error use the --stacktrace option, like this: ./gradlew assembleDebug --stacktrace.

Then you'll see the full error:

Caused by: java.lang.IllegalStateException: Unsupported metadata version. Check that your Kotlin version is >= 1.0
        at dagger.internal.codegen.kotlin.KotlinMetadata.metadataOf(KotlinMetadata.java:216)
        at dagger.internal.codegen.kotlin.KotlinMetadata.from(KotlinMetadata.java:194)
        at dagger.internal.codegen.kotlin.KotlinMetadataFactory.create(KotlinMetadataFactory.java:56)
        at dagger.internal.codegen.kotlin.KotlinMetadataUtil.isCompanionObjectClass(KotlinMetadataUtil.java:86)
        at dagger.internal.codegen.ModuleProcessingStep.process(ModuleProcessingStep.java:116)
        at dagger.internal.codegen.ModuleProcessingStep.process(ModuleProcessingStep.java:59)
        at dagger.internal.codegen.validation.TypeCheckingProcessingStep.lambda$process$0(TypeCheckingProcessingStep.java:51)
        at com.google.common.collect.SingletonImmutableBiMap.forEach(SingletonImmutableBiMap.java:65)
        at dagger.internal.codegen.validation.TypeCheckingProcessingStep.process(TypeCheckingProcessingStep.java:48)
        at dagger.internal.codegen.ModuleProcessingStep.process(ModuleProcessingStep.java:104)
        at dagger.internal.codegen.ModuleProcessingStep.process(ModuleProcessingStep.java:59)
        at dagger.internal.codegen.statistics.DaggerStatisticsCollectingProcessingStep.process(DaggerStatisticsCollectingProcessingStep.java:52)
        at dagger.shaded.auto.common.BasicAnnotationProcessor.process(BasicAnnotationProcessor.java:330)
        at dagger.shaded.auto.common.BasicAnnotationProcessor.process(BasicAnnotationProcessor.java:181)
        at org.jetbrains.kotlin.kapt3.base.incremental.IncrementalProcessor.process(incrementalProcessors.kt:90)
        at org.jetbrains.kotlin.kapt3.base.ProcessorWrapper.process(annotationProcessing.kt:175)
        at jdk.compiler/com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:980)
        ... 41 more

Anyway, this is an issue with Kotlin 1.5.0 and it was fixed in Dagger 2.34, specifically you are hitting #2511. I see the sample project is using 2.27, please update your Dagger version.

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