美文网首页
AndroidStudio编译报错:Can't find ann

AndroidStudio编译报错:Can't find ann

作者: zhaohui0520 | 来源:发表于2021-11-08 11:24 被阅读0次

AndroidStudio 升级到 Arctic Fox 版本后,原来的项目编译报错了:Can't find annotation processor class android.databinding.annotationprocessor.ProcessDataBinding: javax/xml/bind/JAXBException,经各种研究,终于解决。

原因:

Android Studio Arctic Fox 默认使用 JDK 11 编译,而项目中一些三方 gradle 插件使用的是 JDK 1.8 的类,这些类在 JDK 11 中被移除了,所以编译失败。因此需要将编译环境切换到 JDK 1.8 才能正常编译。

解决方法:

Settings > Build execution Deployment > Gradle > Gradle Sdk

选择 Download JDK -> Java 1.8.x,或者选择本地 JDK 1.8 路径;然后 rebuild project 就行了。

参考链接:
https://stackoverflow.com/a/69400822/8794328

相关文章

网友评论

      本文标题:AndroidStudio编译报错:Can't find ann

      本文链接:https://www.haomeiwen.com/subject/qysuzltx.html