square / anvil

A Kotlin compiler plugin to make dependency injection with Dagger 2 easier.
Apache License 2.0
1.31k stars 81 forks source link

Couldn't resolve FqName com.google.protobuf.kotlin.ProtoDslMarker for Anvil #749

Open 0xAliHn opened 1 year ago

0xAliHn commented 1 year ago

Adding all the protobuf dependencies and created proto file. Once trying to build the project seeing this error:

com.squareup.anvil.compiler.api.AnvilCompilationException: Back-end (JVM) Internal error: Couldn't resolve FqName com.google.protobuf.kotlin.ProtoDslMarker for Psi element: com.google.protobuf.kotlin.ProtoDslMarker

Details log:

com.squareup.anvil.compiler.api.AnvilCompilationException: Back-end (JVM) Internal error: Couldn't resolve FqName com.google.protobuf.kotlin.ProtoDslMarker for Psi element: com.google.protobuf.kotlin.ProtoDslMarker File being compiled: (16,4) in *** SampleProtoKt.kt

at com.squareup.anvil.compiler.internal.PsiUtilsKt.requireFqName(PsiUtils.kt:294) at com.squareup.anvil.compiler.internal.PsiUtilsKt.requireFqName(PsiUtils.kt:145) at com.squareup.anvil.compiler.internal.reference.AnnotationReferenceKt.toAnnotationReference(AnnotationReference.kt:227) at com.squareup.anvil.compiler.internal.reference.ClassReference$Psi$annotations$2.invoke(ClassReference.kt:147) at com.squareup.anvil.compiler.internal.reference.ClassReference$Psi$annotations$2.invoke(ClassReference.kt:146) at kotlin.UnsafeLazyImpl.getValue(Lazy.kt:81) at com.squareup.anvil.compiler.internal.reference.ClassReference$Psi.getAnnotations(ClassReference.kt:146)

JoelWilcox commented 10 months ago

@0xAliHn are you still seeing this issue? If so, can you share a branch with your changes and add any other details? At the moment there's not enough info to determine if you're running into a bug in Anvil or something requiring changes in your project.