Proguard-找不到任何超级类 [英] Proguard - Can't find any super classes
问题描述
我收到此错误:
Unexpected error while performing partial evaluation:
Class = [org/apache/log4j/chainsaw/Main]
Method = [<init>()V]
Exception = [java.lang.IllegalArgumentException] (Can't find any super classes of [org/apache/log4j/chainsaw/LoadXMLAction] (not even immediate super class [javax/swing/AbstractAction]))
Error: Can't find any super classes of [org/apache/log4j/chainsaw/LoadXMLAction] (not even immediate super class [javax/swing/AbstractAction])
我的proguard配置的一部分:
Part of my proguard configuration:
-dontwarn javax.jms.**
-dontwarn com.sun.jdmk.comm.**
-dontwarn android.support.v4.**
-dontwarn com.google.api.client.googleapis.extensions.**
-dontwarn org.apache.harmony.**
-dontwarn com.sun.**
-dontwarn org.simpleframework.**
-dontwarn com.google.android.gms.**
-dontwarn org.apache.log4j.lf5.viewer.**
-dontwarn java.beans.**
-dontwarn org.apache.log4j.**
-libraryjars 'D:\Workspace\android\libs\acra-4.5.0.jar'
-libraryjars 'D:\Workspace\android\libs\activation.jar'
-libraryjars 'D:\Workspace\android\libs\additionnal.jar'
-libraryjars 'D:\Workspace\android\libs\android-logging-log4j-1.0.3.jar'
-libraryjars 'D:\Workspace\android\libs\android-support-v4.jar'
-libraryjars 'D:\Workspace\android\libs\annotations.jar'
-libraryjars 'D:\Workspace\android\libs\google-api-client-android-1.12.0-beta.jar'
-libraryjars 'D:\Workspace\android\libs\jtar-1.1.jar'
-libraryjars 'D:\Workspace\android\libs\log4j-1.2.15.jar'
-libraryjars 'D:\Workspace\android\libs\mail.jar'
-libraryjars 'D:\Workspace\android\libs\simple-xml-2.6.9.jar'
有用于log4j的库,那么可能是什么问题?
The library for log4j is there, so what could be the problem?
更新
我发现优化过程中出现了问题. 收缩和混淆正在起作用.
As I have found the problem is raised during optimalization. Shrink and obfuscation is working.
推荐答案
对于那些需要在Android上使用Log4J的快速解决方案的人,Krivers的更新实际上是一个提示:在ProGuard配置中设置-dontoptimize
会关闭优化并从而避免了该错误(尽管这仅应被视为一种解决方法).
For those who need a fast solution on using Log4J on Android, Krivers' update actually served as a hint: setting -dontoptimize
in ProGuard configuration turns off optimization and thus avoids the error (although this should only be considered as a workaround).
实际上,Android Tools项目站点还具有建议关闭ProGuard优化:
In fact, the Android Tools Project Site had also suggested to turn off ProGuard optimization:
Dalvik执行许多自身的优化,并且ProGuard进行的某些优化与Dalvik不兼容,因此为避免难以理解的错误(并且由于净性能增益通常很小),默认配置关闭优化.
Dalvik performs many of its own optimizations, and some of the optimizations performed by ProGuard are incompatible with Dalvik, so to avoid hard-to-figure-out bugs (and because the net performance gain is usually small), the default configuration turns off optimization.
这篇关于Proguard-找不到任何超级类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!