我正在尝试使用 Proguard 处理 MS Windows 桌面应用程序(使用 Eclipse 提供的 SWT 库的 Java 6 SE)。我收到以下严重错误:
Unexpected error while performing partial evaluation:
Class = [org/eclipse/swt/widgets/DateTime]
Method = [<init>(Lorg/eclipse/swt/widgets/Composite;I)V]
Exception = [java.lang.IllegalArgumentException] (Can't find common super class of [java/lang/StringBuffer] and [org/eclipse/swt/internal/win32/TCHAR])
Error: Can't find common super class of [java/lang/StringBuffer] and [org/eclipse/swt/internal/win32/TCHAR]
----------------------------
当我尝试用谷歌搜索这个错误时,它只出现在整个网络的两个地方,这让我大吃一惊。 我是使用 Proguard 和 Java 代码优化工具的新手。 任何解决此问题的想法和建议,将不胜感激。提前致谢。
以上错误现已修复,使用“-dontskipnonpubliclibraryclasses”
--最终更新:
我现在仍然遇到另一个错误。 整个输出现在如下:
D:\eclipse_projs\java_obfuscate\gci>gci.bat
ProGuard, version 4.4
Reading program jar [D:\eclipse_projs\java_obfuscate\gci\gci.jar]
Reading library jar [D:\jre1.6.0_07\lib\rt.jar]
Unexpected error while evaluating instruction:
Class = [org/eclipse/swt/widgets/Synchronizer]
Method = [runAsyncMessages(Z)Z]
Instruction = [60] aload_1 v1
Exception = [java.lang.IllegalArgumentException] (Value is not a reference value [proguard.evaluation.value.UnknownIntegerValue])
Unexpected error while performing partial evaluation:
Class = [org/eclipse/swt/widgets/Synchronizer]
Method = [runAsyncMessages(Z)Z]
Exception = [java.lang.IllegalArgumentException] (Value is not a reference value [proguard.evaluation.value.UnknownIntegerValue])
Error: Value is not a reference value [proguard.evaluation.value.UnknownIntegerValue]
D:\eclipse_projs\java_obfuscate\gci>
这是一个我无法确定的问题:(任何帮助将不胜感激。
我使用的选项如下:
-dontskipnonpubliclibraryclasses
-dontskipnonpubliclibraryclassmembers
-optimizationpasses 3
-overloadaggressively
-repackageclasses ''
-allowaccessmodification
-dontnote
最佳答案
尝试将选项 -dontskipnonpubliclibraryclasses
添加到命令行。
来自Proguard Manual :
Limitations
For efficiency, ProGuard always ignores any private or package visible library classes while reading library jars. If any of them are extended by public library classes, and then extended again by input classes, ProGuard will complain it can't find them. In that case, you'll have to use the-dontskipnonpubliclibraryclasses
option, and maybe even the-dontskipnonpubliclibraryclassmembers
option. The graphical user interface has checkboxes for these settings.
关于java - 错误 : Can't find common super class of ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2591602/