我收到此错误:
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配置的一部分:
-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的库,那么可能是什么问题?
更新
正如我发现的那样,在优化过程中会出现问题.
收缩和混淆正在起作用.
解决方法:
对于需要在Android上使用Log4J的快速解决方案的用户,Krivers的更新实际上是一个提示:在ProGuard配置中设置-dontoptimize将关闭优化,从而避免出现错误(尽管这仅应视为解决方法).
实际上,Android Tools Project网站也有suggested to turn off ProGuard optimization:
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.