当前位置: 代码迷 >> 综合 >> Android报错:ANTLR Tool version 4.5.3 used for code generation does not match the current runtime versi
  详细解决方案

Android报错:ANTLR Tool version 4.5.3 used for code generation does not match the current runtime versi

热度:62   发布时间:2023-12-15 04:50:27.0

问题

报错: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.1

解决

在 app 的 build.gradle 中加入:

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

如图:
在这里插入图片描述结果还是失败,然后将4.7.1换为4.5.3,成功之后 run

run 之后还是失败:

在这里插入图片描述

  相关解决方案