Compiler errors on java 11
See original GitHub issueOn Android Studio 4.2, which comes bundled with java 11, the project I’m working on doesn’t build anymore.
C:\...\app\build\tmp\kapt3\stubs\...\MainApplication.java:60: error: [ComponentProcessor:MiscError] dagger.internal.codegen.ComponentProcessor was unable to process this class because not all of its dependencies could be resolved. Check for compilation errors or a circular dependency with generated code.
public class MainApplication extends com...BaseApplication implements dagger.android.HasAndroidInjector {
^C:\...\app\src\main\java\com\...\dependency_injection\ApplicationModule.java:26: error: [ComponentProcessor:MiscError] dagger.internal.codegen.ComponentProcessor was unable to process this class because not all of its dependencies could be resolved. Check for compilation errors or a circular dependency with generated code.
public class ApplicationModule {
^C:\Users\...\app\src\main\java\com\...\dependency_injection\AppComponent.java:162: error: [ComponentProcessor:MiscError] dagger.internal.codegen.ComponentProcessor was unable to process this interface because not all of its dependencies could be resolved. Check for compilation errors or a circular dependency with generated code.
public interface AppComponent {
^
> Task :app:kaptDebugKotlin FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:kaptDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptExecution
> java.lang.reflect.InvocationTargetException (no error message)
The same project builds successfully with java 8.
Are there projects where dagger 2 works with java 11 already? If so, how can I debug and see why build fails on this project?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:7
- Comments:16 (2 by maintainers)
Top Results From Across the Web
Can't Compile Java 11 Code With Source Options
I am trying to use Java 11 module as dependency on Java 1.8 project. When I try to compile Java 11 module, maven...
Read more >Fix the top 10 most common compile time errors in Java
Top 10 common Java compile errors and how to fix them · 1. Class and source file mismatch · 2. Improper casing ·...
Read more >JDK 11: Compilation failed due to internal java compiler error
JDK 11: Compilation failed due to internal java compiler error ... this sample can be successful compiled using Maven(JDK11) command "mvn clean compile"....
Read more >AEM 6.5.2 compilation errors with JDK 11
This issue seems to be coming from the maven-scr-plugin. By moving to Java 11, the class files that you create will be compiled...
Read more >[#SCXML-287] Compilation error when compiling with Java-11
When compiling with the Java-11 compiler (although source/binary version is set to 1.8), the compilation fails with: [ERROR] ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I simplified the repro project that was posted earlier in the thread: https://github.com/drewhannay/data-binding-dagger-jdk11-crash
I stripped out
kapt
and Kotlin entirely. I also removeddagger-android
as it was not relevant.It seems the minimum necessary to reproduce this bug is to use a data binding
@BindingAdapter
AND to run thedagger-compiler
annotation processor. If I remove dagger from the project entirely, the crash does not reproduce. Likewise, if I remove the data binding@BindingAdapter
, the crash does not reproduce. So there is some combination of the two that is producing this compiler crash.Since the upcoming AGP 7 release will require JDK 11, this seems pretty urgent to address.
Sorry for the delay, I was able to reproduce this but I still haven’t had time to debug yet – I’ll try to look into it this week.
However, from the new error message you posted in https://github.com/google/dagger/issues/2144#issuecomment-712436284, I don’t think that error is related to the
SuperficialValidation
. It seems to be something up withkapt
.For now, one workaround you can try is to create a concrete type of
DataBindingComponent
, e.g.Then you can have users inject
MyDataBindingComponent
.