I had recently upgraded to gradle plugin 2.3.0 and the gradle version to 4.3.1. Post that upgrade the debug build is failing with the following stack trace. Have no clue what is going wrong and where. For sure there is something related to data-bindings as per the logs but what is it I could not get the pointers. Need help.
cannot generate view binders java.lang.StackOverflowError
00:16:40,443 ERROR - 00:16:40.422 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at android.databinding.tool.reflection.annotation.AnnotationTypeUtil.toJava(AnnotationTypeUtil.java:176)
00:16:40,443 ERROR - 00:16:40.422 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at android.databinding.tool.reflection.annotation.AnnotationTypeUtil.toJava(AnnotationTypeUtil.java:149)
00:16:40,443 ERROR - 00:16:40.422 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at android.databinding.tool.reflection.annotation.AnnotationTypeUtil.toJava(AnnotationTypeUtil.java:249)
00:16:40,443 ERROR - 00:16:40.422 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at android.databinding.tool.reflection.annotation.AnnotationTypeUtil.toJava(AnnotationTypeUtil.java:151)
00:16:40,443 ERROR - 00:16:40.422 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at android.databinding.tool.reflection.annotation.AnnotationTypeUtil.lambda$toJava$1(AnnotationTypeUtil.java:188)
00:16:40,443 ERROR - 00:16:40.422 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
00:16:40,443 ERROR - 00:16:40.422 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at java.util.Iterator.forEachRemaining(Iterator.java:116)
00:16:40,444 ERROR - 00:16:40.422 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
00:16:40,444 ERROR - 00:16:40.422 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
00:16:40,444 ERROR - 00:16:40.422 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
00:16:40,444 ERROR - 00:16:40.422 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
00:16:40,444 ERROR - 00:16:40.423 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
00:16:40,444 ERROR - 00:16:40.423 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter] at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
Post this the stack trace just repeats with this same issue endlessly.
After some investigation I figured out this was due to the log level set to INFO for my build and the machine was running out of memory. On changing the log level to "DEBUG" it was resolved.