Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ANTLR Tool version 4.7.1 used for code generation does not match the current runtime version 4.5.3

Tags:

android

kotlin

Im working on an Android App, currently using DSL and some libraries, suddenly the build gave me this error.

Task :app:kaptDebugKotlin FAILED ANTLR Tool version 4.7.1 used for code generation does not match the current runtime version 4.5.3ANTLR Runtime version 4.7.1 used for parser compilation does not match the current runtime version 4.5.3 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)

i've been searching but with no success...

If you wanna see the issue you can clone the project. Project GITHUB Im using Android Studio Canary 4.1.

like image 527
Luis Cardoza Bird Avatar asked Mar 10 '20 13:03

Luis Cardoza Bird


People also ask

What is Antlr runtime?

ANTLR (ANother Tool for Language Recognition) is a tool for processing structured text. It does this by giving us access to language processing primitives like lexers, grammars, and parsers as well as the runtime to process text against them. It's often used to build tools and frameworks.


2 Answers

Removing suspend keyword from queries in DAO interface, solved my problem

like image 79
Ercan Avatar answered Oct 06 '22 01:10

Ercan


The problem was fixed for me by changing this. from:

implementation "androidx.room:room-runtime:$depVersion"
implementation "androidx.room:room-compiler:$depVersion"

to:

implementation "androidx.room:room-runtime:$depVersion"
annotationProcessor "androidx.room:room-compiler:$depVersion"
like image 22
Tim K. Avatar answered Oct 06 '22 00:10

Tim K.