项目引入了日志包log4j-api-2.10.0.jar,log4j从2.9版本开始支持JDK9,当前项目使用混淆器proguard5.3.3对代码进行混淆,proguard5.3.3只对JDK支持到1.8,混淆时会报错
Can't read [D:\proguardConfig\lib\log4j-api-2.10.0.jar] (Can't process class [META-INF/versions/9/org/apache/logging/log4j/util/ProcessIdUtil.class] (Unsupported class version number [53.0] (maximum 52.0, Java 1.8)))
要解决报错需屏蔽log4j中使用java9 api的类。在proguard的配置文件中log4j-api-2.10.0.jar后面加入(!META-INF/versions/9/**.class,!module-info.class)
配置文件示例
-libraryjars lib\log4j-api-2.10.0.jar(!META-INF/versions/9/**.class,!module-info.class)
-libraryjars lib\log4j-core-2.10.0.jar
-libraryjars lib\log4j-jcl-2.10.0.jar
-libraryjars lib\log4j-web-2.10.0.jar
网友评论