Log4j2.8.2 SimException 问题

Log4j2.8.2 SimException Issue

我必须将 log4j1.2.17 移动到 log4j2.8.2。我在 android build.gradle 中为 log4j2 实现做了以下更改。

implementation 'org.apache.logging.log4j:log4j-core:2.8.2'
implementation 'org.apache.logging.log4j:log4j-slf4j-impl:2.8.2'
implementation 'org.apache.logging.log4j:log4j-1.2-api:2.8.2'

另外,正如一些 Whosebug 中所解释的,我做了如下所述的 proguard 更改:

#log4j2
-dontwarn org.apache.logging.log4j.**
-keepattributes Signature
-keep class org.apache.logging.log4j.** { *; }

使用 maven 构建项目后,堆栈跟踪如下:

[INFO] Uncaught translation error: com.android.dx.cf.code.SimException: ERROR in org.apache.logging.log4j.core.config.plugins.convert.DateTypeConverter.fromMillis:(JLjava/lang/Class;)Ljava/util/Date;: invoking a signature-polymorphic requires --min-sdk-version >= 26 (currently 13) [INFO] Uncaught translation error: com.android.dx.cf.code.SimException: ERROR in org.apache.logging.log4j.core.impl.ContextDataFactory.createContextData:()Lorg/apache/logging/log4j/util/StringMap;: invoking a signature-polymorphic requires --min-sdk-version >= 26 (currently 13)

我从 Whosebug 尝试了很多解决方案,但找不到相同的确切解决方案。以下是链接:

SimException on proguard build, Android Studio?

请提出任何可以帮助我解决上述问题的解决方案。谢谢!

经过大量挖掘后,我了解到问题不在于 proguard.Then 我最终将 logcat 保存到文本文件中,如下所述 link:

Link

希望这对其他人有帮助。