当我遇到 65K 方法问题时,我将我的项目从 Eclipse 迁移到 AS。在解决了我最初在 AS 中遇到的每个依赖问题之后,我陷入了这个问题,无论我从博客和 SO 本身的其他类似帖子中尝试什么,这个问题似乎都不会消失。
我检查了 Annotation Processors 中的Enable Annotation Processing并给出了处理器路径。(甚至尝试使用从项目类路径获取处理器)但是每当我运行项目时,它都会出现以下错误:
Error:(8, 8) error: duplicate class: list.EventsListAdapter$ViewHolder$$ViewInjector
Error:Execution failed for task ':ProjectDemo:compileDebugJava'.
Compilation failed; see the compiler error output for details.
在我的 gradle 文件中,我根据其他人的建议添加了以下内容:
applicationVariants.all { variant ->
variant.outputs.each { output ->
def file = output.outputFile
output.outputFile = new File(file.parent, file.name.replace(".apk", "-" + defaultConfig.versionName + ".apk"))
}
}
但结果是一样的。
我究竟做错了什么?另外,如果您需要有关此的更多详细信息,请告诉我。我对 AS 有点陌生,可能错过了一些明显的东西。
提前致谢。