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
error: compiler message file broken: key=compiler.err.Processor #1263
Comments
This is probably a Kotlin bug. Can you post a sample project? |
I have also opened a ticket for Kotlin, but because everything works fine on 2.15 this could also be a dagger issue. |
@AAverin can you please link the kotlin bug you created? edit: sorry, nevermind, it was pretty easy to find: https://youtrack.jetbrains.com/issue/KT-26397 |
What's the status on this? I've been struggling for a long time getting an Instant App working and now most recently I got this error, and I'm writing it in Kotlin. |
@ronshapiro I was able to reproduce the problem and have created a sample project https://github.com/giem/KaptDaggerBug Basically the problem happens if you have a multi gradle project, and one of the gradles submodules imports something, but doesn't expose it to the parent. (like RxJava in the example project). Not sure if this is a dagger or kapt problem. |
I got the error because my base module had a dependency on
So if you end up hitting this error, double check the libraries you're trying to access and whether those are truly imported in the right modules or "re-exported" in submodules, depending on how you setup your gradle files. |
I'm not seeing how this could be a Dagger error. Dagger only operates at the Java compiler level. If the Kotlin issue uncovers anything inside Dagger we can reopen this. |
I've gotten this several times in situations like this: class MyThing @Inject constructor() {
fun doStuff() { doPrivateStuff(SomeDependency()) }
// kapt crashes when parsing this method if SomeDependency is
// declared in a dependency included with `implementation`
private fun doStuff(someDependency: SomeDependency) {}
} In those situations you can easily mark the offending functions as |
I ran into same error, inside my project I had following situation
I had not written a function signature returning the dependency inside HomeComponent. Which is causing this issue. After adding a method signature everything works normally.
|
This error is not related with Kotlin. I can reproduce it with a java only project: https://github.com/BraisGabin/daggerprocessorwrapper |
@cgdecker are you able to take a look at the latest sample project that was posted? |
Perhaps the issue is related to Gradle? I tried a similar setup to that sample project with just Maven modules (and nothing Android-related) and didn't run into any issue. |
I have solved same problem by adding missed dependency to app module. |
@BraisGabin I can't reproduce the error on your project, either on the last commit, or the previous one in Kotlin.
which is expected as …and strangely with Java 11 it compiles without error (that's a bug in Gradle or the Android Gradle Plugin, it should fail).
Might be related to you JDK flavor and/or version. |
Using @giem's sample project (#1263 (comment)), my output is:
so bug very likely is related to the JDK flavor/version.
|
Ok, to ensure that the tests are reproducible I configured travis in my test project. The results I get:
So as far as I can understand this error is related with the JDK8. So, if we move to JDK11 it'll work. The problem is that if we need to use Is this a "wont fix" or should we support JDK8? |
Wait a minute: this issue is about the error message only, which you didn't reproduce. The failure you're seeing is tracked at #970 |
🤐 Sorry, I miss read the issue. |
I had the same issue with a multi-module project I was working on last week. Turns out I was injecting an object with a transitive dependency from another module. Adding the dependency directly into the module not compiling solved my issue. |
Kotlin 2.61
A missing
@Provides
annotation in Module on Dagger 2.17 results inerror: compiler message file broken: key=compiler.err.Processor: org.jetbrains.kotlin.kapt3.base.ProcessorWrapper@550c0cf8 arguments={0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}
A missing
@Provides
annotation in Module on Dagger 2.15 results in a meaningful exception describing which dependency could not be providedThe text was updated successfully, but these errors were encountered: