Skip to content
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

ANTLR Tool version 4.5.3 does not match the current runtime version 4.6 #1782

Open
johnsonGong opened this issue Mar 22, 2017 · 21 comments
Open

Comments

@johnsonGong
Copy link

hello:
i'm using antlr-4.6-complete.jar in my project, but the console show the logs below:


ANTLR Tool version 4.5.3 used for code generation does not match the current runtime version 4.6
ANTLR Runtime version 4.5.3 used for parser compilation does not match the current runtime version 4.6

[main] INFO cz.vutbr.web.csskit.antlr4.SimplePreparator - Created RuleSet as with:
li {
display: list-item;
}

/* *** *** *** *** */

  1. I am not use the antlr Tool(4.5.3);
  2. the project is about CSSBOX(cssbox-4.12.jar);
  3. please give me some advices. thanks.
@davesisson
Copy link
Contributor

davesisson commented Mar 22, 2017 via email

@johnsonGong
Copy link
Author

johnsonGong commented Mar 22, 2017

oh... but is there any Manual to slove this problem now? I am studying how to use CSSbox.


OR the antlr version 4.5.3 can work?
thanks.
ps: I can't find the past version list in the offical download page.
now(20170322) the offical verions is 4.6

@davesisson
Copy link
Contributor

davesisson commented Mar 22, 2017 via email

@normenmueller
Copy link

normenmueller commented Nov 9, 2017

@davesisson You stated that this issue is fixed in v4.7, but I get

ANTLR Tool version 4.5.3 used for code generation does not match the current runtime version 4.7ANTLR Runtime version 4.5.3 used for parser compilation does not match the current runtime version 4.7ANTLR Tool version 4.5.3 used for code generation does not match the current runtime version 4.7ANTLR Runtime version 4.5.3 used for parser compilation does not match the current runtime version 4.7

Though I have to admit, that I build my parser utilizing v4.7 and calling a foreign parser (spark-sql), like:

val sqlParser = new org.apache.spark.sql.catalyst.parser.CatalystSqlParser(new SQLConf())

override def visitSelect(ctx: MyParser.SelectContext): LogicalPlan = withOrigin(ctx) {
  sqlParser.parsePlan(ctx.selectStatement())
}

Is this an issue or just a warning?

BTW, just checked the Spark source code and the pom.xml in particular:

<antlr4.version>4.7</antlr4.version>

So, they also use v4.7.

Update: Misinformation! The parser from Spark v2.2 causes the problem. The parser from Spark v2.3 no longer produces this message. All good.

@borisalmonacid
Copy link

ANTLR Tool version 4.7 used for code generation does not match the current runtime version 4.5.1

@davesisson
Copy link
Contributor

davesisson commented Nov 13, 2017 via email

@normenmueller
Copy link

@davesisson cf. my update.

@lucidBrot
Copy link

This seems to still be the case in 4.7.1.
ANTLR Tool version 4.4 used for code generation does not match the current runtime version 4.7.1ANTLR Tool version 4.4 used for code generation does not match the current runtime version 4.7.1[1 = javali_tests\HW1\HelloWorld.javali]

I'm using intelliJ IDEA2017.3.5 (Ultimate Edition) with the ANTLR v4 grammar plugin (Version 1.8.4)
It seems that everything is running, even with that message.
The generated Lexer and Parser contain a comment // Generated from Javali.g4 by ANTLR 4.4.

@rostislavprovodenko
Copy link

rostislavprovodenko commented Apr 13, 2018

I'm experiencing the same problem in 4.7.0. and 4.7.1

@davesisson
Copy link
Contributor

davesisson commented Apr 13, 2018 via email

@syslogic
Copy link

fixed this in an Android project; where the data-binding library clashed with the Room persistence library:

configurations.all() {
    resolutionStrategy.force "org.antlr:antlr4-runtime:4.7.1"
    resolutionStrategy.force "org.antlr:antlr4-tool:4.7.1"
}

@Yubyf
Copy link

Yubyf commented Mar 22, 2019

fixed this in an Android project; where the data-binding library clashed with the Room persistence library:

configurations.all() {
    resolutionStrategy.force "org.antlr:antlr4-runtime:4.7.1"
    resolutionStrategy.force "org.antlr:antlr4-tool:4.7.1"
}

I used your config in my build.gradle of application but the warning was still not disappeared.
gradle version: 4.8
Android Studio version: 3.3.2


Update:
In my project, I downgraded the version to 4.5.3 to solve the problem:

configurations.all() {
    resolutionStrategy.force "org.antlr:antlr4-runtime:4.5.3"
    resolutionStrategy.force "org.antlr:antlr4-tool:4.5.3"
}

@sbatezat
Copy link

sbatezat commented Nov 5, 2019

@syslogic & @Yubyf
I've got the same problem than you on my Android Project.
It seems I can't use Flowable in Room DAO, with databinding enabled:

ANTLR Tool version 4.5.3 used for code generation does not match the current runtime version 4.7.1ANTLR Runtime
[...]
method RxRoom.createFlowable(RoomDatabase,String...) is not applicable
(varargs mismatch; boolean cannot be converted to String)

If I change Flowable to Single, I've got no more issue (except a Single is not what I need!)
Obviously I tried to fix the antlr version to 4.5.3 or 4.7.1 but:

  • FIxing to 4.7.1 has no effect (same error message)
  • Fixing to 4.5.3 is throwing that error:

What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.

java.lang.NoClassDefFoundError: org/antlr/v4/runtime/CharStreams

Any thought? Are you using Flowable and what are the versions of your dependencies ?


Update

My bad, I was using the wrong package name for room-rxjava2 (android.arch instead of androidx.room)... Everything all right!

@ekoleszar
Copy link

ekoleszar commented Mar 27, 2020

Same error occurs to me when using a DataBiding Converter. I've tried @syslogic solution without success. My installation:
Android Studio: 3.6.1
gradle-5.6.4
Androidk SDK 29

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

stack.log

@zhigangguo
Copy link

Same error occurs to me when using a DataBiding Converter. I've tried @syslogic solution without success. My installation:
Android Studio: 3.6.1
gradle-5.6.4
Androidk SDK 29

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

stack.log
same error occurs to me

@koreravi30
Copy link

koreravi30 commented Apr 7, 2020

same errror inAndroid Studio
Android Studio v:3.6.1
SDK 28
gradle 5.6.4

Task :app:kaptDebugKotlin
ANTLR Tool version 4.5.3 used for code generation does not match the current runtime version 4.7.1ANTLR Runtime version 4.5.3 used for parser compilation does not match the current runtime version 4.7.1ANTLR Tool version 4.5.3 used for code generation does not match the current runtime version 4.7.1ANTLR Runtime version 4.5.3 used for parser compilation does not match the current runtime version 4.7.1C:\Users\xt\AndroidStudioProjects\Demo2\app\build\generated\source\kapt\debug\com\example\demo2\DataBinderMapperImpl.java:9: error: cannot find symbol
import com.example.demo2.databinding.ActivityLoginBindingImpl;
^
symbol: class ActivityLoginBindingImpl

@ldj790940278
Copy link

@Query("SELECT * FROM GOODS ORDER BY ID DESC")
void queryAll();
when i update void to LiveData,i solve it,like this
LiveData<Goods> queryAll();

@ericvergnaud
Copy link
Contributor

ericvergnaud commented Apr 15, 2020 via email

@koreravi30
Copy link

Hi, may I ask that you please move this conversation to the Google discussion group? Eric

Le 15 avr. 2020 à 12:49, Martin Zeitler @.***> a écrit : @ldj790940278 https://github.com/ldj790940278 I don't think this is related; besides ...why would one want to return void there ?? — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#1782 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZNQJAPKCDJXS5LZHRZAS3RMU4GPANCNFSM4DESX6UQ.

okay

@fbacchella
Copy link

This message can be quite painful, as there is no way to hide it. I'm writing code that uses antlr and that code uses a library that uses antlr too. Of course versions are not in sync. Having this warning during tests is OK, but in the long run it's messy. I think a property to disable this warning would be welcome.

@ClimberBear
Copy link

In my case, I had migrated the full android application to run under androidx support libraries, but I forgot to upgrade the test configuration.

I followed the instructions in
Espresso configuration
and the warning dissapeared.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests