antlr / antlr4

ANTLR (ANother Tool for Language Recognition) is a powerful parser generator for reading, processing, executing, or translating structured text or binary files.
http://antlr.org
BSD 3-Clause "New" or "Revised" License
16.93k stars 3.26k forks source link

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

Open johnsonGong opened 7 years ago

johnsonGong commented 7 years ago

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 commented 7 years ago

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 .

johnsonGong commented 7 years ago

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 commented 7 years ago

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 .

normenmueller commented 6 years ago

@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 commented 6 years ago

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

davesisson commented 6 years ago

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 .

normenmueller commented 6 years ago

@davesisson cf. my update.

lucidBrot commented 6 years ago

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 commented 6 years ago

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

davesisson commented 6 years ago

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 < notifications@github.com> 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 .

syslogic commented 5 years ago

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 commented 5 years ago

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 commented 4 years ago

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

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago
@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 commented 4 years ago

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.

koreravi30 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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.