butterknife compiler error in android studio

huangapple go评论57阅读模式
英文:

butterknife compiler error in android studio

问题

"因果:超类访问检查失败:类 butterknife.compiler.ButterKnifeProcessor$RScanner(在未命名的模块 @0x509fdebb 中)无法访问类 com.sun.tools.javac.tree.TreeScanner(在模块 jdk.compiler 中),因为模块 jdk.compiler 未将 com.sun.tools.javac.tree 导出到未命名的模块 @0x509fdebb。"

我导入了一个在 JDK 11 环境下构建的项目到 Android Studio 中。我目前在使用带有 JDK 11 的 Android Studio Flaming。

当我在互联网上研究这个错误时,它给了我一些关于创建 module-info.java 文件的解决方案。但我不知道如何将这个文件添加到我的项目中。还有一些解决方案建议切换到 JDK 11,但我已经这样做了,但对我来说仍然没有解决问题。

英文:

"Cause: superclass access check failed: class butterknife.compiler.ButterKnifeProcessor$RScanner (in unnamed module @0x509fdebb) cannot access class com.sun.tools.javac.tree.TreeScanner (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.tree to unnamed module @0x509fdebb"

I imported a project which was built in jdk 11 enviroment on android studio. I am currently using android studio flaming with jdk 11.

when i researched about this error on internet and it gave me some solutions of making some module-info.java file. but i dont how to add this file on my project. also some solutions said to turn to jdk 11 which i did already. but still it didnt work out for me.

答案1

得分: 1

在gradle中使用JDK版本11而不是16,我使用JDK16导致错误,当我修改为JDK11时,一切开始正常工作。

英文:

It bugged my head and later I found the solution, it is in gradle use the JDK version 11 instead of 16. I was using JDK16, which causes the error. When I modified to JDK 11, it all started working fine.

huangapple
  • 本文由 发表于 2023年5月15日 15:35:52
  • 转载请务必保留本文链接:https://go.coder-hub.com/76251821.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定