Antlr4: ANTLR Tool version 4.5.3 does not match the current runtime version 4.6

Created on 22 Mar 2017  Â·  21Comments  Â·  Source: antlr/antlr4

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.

Most helpful comment

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"
}

All 21 comments

Fixed in 4.7.

On Tue, Mar 21, 2017 at 8:37 PM gongl notifications@github.com wrote:

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.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/antlr/antlr4/issues/1782, or mute the thread
https://github.com/notifications/unsubscribe-auth/ALUC_VyLrY_FewO12Lh0ADgZvZu3tYC1ks5roJeCgaJpZM4Mkr-p
.

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

The code works fine despite the warning. The problem is that the
XPathLexer library was built with 4.5.3 so whenever you use that API you
will get that message.

See #1620 for more information.

On Tue, Mar 21, 2017 at 8:48 PM gongl notifications@github.com wrote:

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.

—
You are receiving this because you commented.

Reply to this email directly, view it on GitHub
https://github.com/antlr/antlr4/issues/1782#issuecomment-288290787, or mute
the thread
https://github.com/notifications/unsubscribe-auth/ALUC_fYUhPbQxIau087e7L4uRox6r0keks5roJoHgaJpZM4Mkr-p
.

@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.

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

This happened when xPath was called because it used an earlier version of
antlr4 to build the tool. xPath now uses a hand rolled parser so this
can't happen. The message you're showing is most likely because you're
using an older runtime. Its it possible that you're linking in an older
runtime (from some other library) and calling it?

On Mon, Nov 13, 2017, 00:59 borisalmonacid notifications@github.com wrote:

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

—
You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub
https://github.com/antlr/antlr4/issues/1782#issuecomment-343853769, or mute
the thread
https://github.com/notifications/unsubscribe-auth/ALUC_UgMxCrM8wSv9gz29EG0cpcqXOdHks5s2AUBgaJpZM4Mkr-p
.

@davesisson cf. my update.

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.

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

It seems like you're actually getting the case that the message is intended
to warn you about:

You are generating the code with something using the Antlr4.4 library and
then trying to link it against the 4.7.1 runtime. Make sure whatever
you're generating with is updated to use 4.7.1.

On Fri, Apr 13, 2018 at 4:58 AM rostislavprovodenko <
[email protected]> wrote:

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

—
You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub
https://github.com/antlr/antlr4/issues/1782#issuecomment-381113329, or mute
the thread
https://github.com/notifications/unsubscribe-auth/ALUC_Ufps8-ZCIogVqD7P30nlrv78aS8ks5toJLVgaJpZM4Mkr-p
.

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"
}

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"
}

@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!

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 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

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\xtAndroidStudioProjects\Demo2\app\build\generated\source\kapt\debug\com\example\demo2DataBinderMapperImpl.java:9: error: cannot find symbol
import com.example.demo2.databinding.ActivityLoginBindingImpl;
^
symbol: class ActivityLoginBindingImpl

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

Hi,

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

Eric

Le 15 avr. 2020 à 12:49, Martin Zeitler notifications@github.com 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 https://github.com/antlr/antlr4/issues/1782#issuecomment-613814337, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZNQJAPKCDJXS5LZHRZAS3RMU4GPANCNFSM4DESX6UQ.

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

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.

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

anidotnet picture anidotnet  Â·  55Comments

Usnul picture Usnul  Â·  14Comments

tarantsoff picture tarantsoff  Â·  44Comments

fvictorio picture fvictorio  Â·  12Comments

ngundu picture ngundu  Â·  18Comments