首页 > 编程学习 > android 33 升级踩坑 2

android 33 升级踩坑 2

发布时间:2023/3/29 5:08:30
遇到问题

升级完 gradle 相关配置后,编译提醒 java 编译异常
An exception has occurred in the compiler (1.8.0_271). Please file a bug against the Java compiler via the Java bug reporting page (http://bugreport.java.com) after checking the Bug Database (http://bugs.java.com) for duplicates. Include your program and the following diagnostic in your report. Thank you.
06:54:28 java.lang.AssertionError: annotationType(): unrecognized Attribute name MODULE (class com.sun.tools.javac.util.UnsharedNameTable$NameImpl)

一直以为是gradle 版本不匹配导致,进入误区。根本原因是因为,编译依赖的JDK 版本不匹配导致。
android 33
gradle-build-tool :3.6.4
gradle-wrapper.properties 版本最低需要 5.6.4

如果使用android studio 需要勾选gradle jdk 配置
file-->settings-->Build,Execution,Deployment-->build Tools-->Gradle-->Gradle JDK
JDK 安装路径 xx\xx\xx\jdk-11.0.17
Copyright © 2010-2022 mfbz.cn 版权所有 |关于我们| 联系方式|豫ICP备15888888号