ANTLR Tool version 4.7.2 used for code generation does not match the current runtime version 4.5.3
See original GitHub issueIssue Description
Trying to use the Gradle plugin in one of my project, created a separate module for GraphQL codegen. Everytime when I run graphqlCodegen
it’s fail with an error:
ANTLR Tool version 4.7.2 used for code generation does not match the current runtime version 4.5.3
Caused by: java.lang.UnsupportedOperationException: java.io.InvalidClassException: org.antlr.v4.runtime.atn.ATN; Could not deserialize ATN with UUID 59627784-3be5-417a-b9eb-8131a7286089 (expected aadb8d7e-aeef-4415-ad2b-8204d6cf042e or a legacy UUID).
at org.antlr.v4.runtime.atn.ATNDeserializer.deserialize(ATNDeserializer.java:153)
at graphql.parser.antlr.GraphqlLexer.<clinit>(GraphqlLexer.java:276)
Steps to Reproduce
git clone git@github.com:expatiat/dumper.git
cd dumper/dumper-api-interface
../gradlew clean graphqlCodegen --info --stacktrace
Your Environment and Setup
- graphql-java-codegen version: 4.1.5
- Build tool: Gradle 6.8.3
- Mapping Config: E.g.:
plugins {
`java-library`
id("io.github.kobylynskyi.graphql.codegen") version "4.1.5"
}
tasks.named<io.github.kobylynskyi.graphql.codegen.gradle.GraphQLCodegenGradleTask>("graphqlCodegen") {
graphqlSchemaPaths = listOf(
"$projectDir/../dumper-api/src/main/resources/graphql/dumper.graphqls",
"$projectDir/../dumper-api/src/main/resources/graphql/include/dumper-enums.graphqls",
"$projectDir/../dumper-api/src/main/resources/graphql/include/dumper-errors.graphqls",
"$projectDir/../dumper-api/src/main/resources/graphql/include/dumper-inputs.graphqls",
"$projectDir/../dumper-api/src/main/resources/graphql/include/dumper-payloads.graphqls",
"$projectDir/../dumper-api/src/main/resources/graphql/include/dumper-types.graphqls"
)
outputDir = File("$buildDir/generated")
packageName = "com.example.graphql.model"
}
sourceSets {
getByName("main").java.srcDirs("$buildDir/generated")
}
tasks.named<JavaCompile>("compileJava") {
dependsOn("graphqlCodegen")
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
ANTLR Tool version 4.5.3 used for code generation does ...
This is a known problem with some databinding versions (which is embedded in Android Studio) and other dependencies like Room which import ...
Read more >ANTLR Tool version 4.5.3 does not match the current ...
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 ...
Read more >ANTLR Tool version 4.7.2 used for code generation does ...
Native Build - ANTLR Tool version 4.7. 2 used for code generation does not match the current runtime version 4.8.
Read more >ANTLR Tool version mismatch with Room build error
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 ......
Read more >ANTLR Tool version 4.5.3 used for code generation does not ...
Android : ANTLR Tool version 4.5.3 used for code generation does not match the current runtime version 4.7.1 [ Beautify Your Computer ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi, @kobylynskyi!
I found the reason why I’m getting this error. The error came after I’m adding the Gradle Kotlin JVM plugin.
When I add this to
plugins
:I’m starting to get this error:
I have tried with the latest Kotlin plugin and it works fine, no exception:
Yes that was what i found while debugging it. The 5.0.0 release should fix it since Apollo ANTLR is on a later version. Thanks for the advise.