在android中proguard jsoup时出现意外错误
我的android项目有Jsoup(1.6.1)作为外部库,但是proguard(使用ADT生成的默认proguard.cfg)告诉存在意外错误,例如:
[proguard] 评估指令时出现意外错误:
[proguard] 类 = [org/jsoup/parser/TreeBuilder]
[proguard]方法= [insertInFosterParent(Lorg/jsoup/nodes/Node;)V]
[proguard]指令 = [64] aload_2 v2
[proguard] 异常 = [java.lang.NullPointerException] (null)
[proguard] 执行部分评估时出现意外错误:
[proguard] 类 = [org/jsoup/parser/TreeBuilder]
[proguard]方法= [insertInFosterParent(Lorg/jsoup/nodes/Node;)V]
[proguard] 异常 = [java.lang.NullPointerException] (null)
我有发现许多帖子都存在其他库的类似问题,并且 -dontoptimize 可以消除此类错误,但会降低优化效果(作为 proguard.cfg 中的默认值: -optimizationpasses 5)
有人可以帮助我吗?或者这是 Jsoup 的潜在问题?
My android project have Jsoup(1.6.1) as the external library, but proguard(with the default proguard.cfg generated by ADT) tells there are unexpected errors, such as:
[proguard] Unexpected error while evaluating instruction:
[proguard] Class = [org/jsoup/parser/TreeBuilder]
[proguard] Method = [insertInFosterParent(Lorg/jsoup/nodes/Node;)V]
[proguard] Instruction = [64] aload_2 v2
[proguard] Exception = [java.lang.NullPointerException] (null)
[proguard] Unexpected error while performing partial evaluation:
[proguard] Class = [org/jsoup/parser/TreeBuilder]
[proguard] Method = [insertInFosterParent(Lorg/jsoup/nodes/Node;)V]
[proguard] Exception = [java.lang.NullPointerException] (null)
I have found many posts with the similiar issue for other libraries, and -dontoptimize can remove such errors, but it would degrade the optimization (as the default value in proguard.cfg: -optimizationpasses 5)
Anyone could help me on this? or is it a potential issue of Jsoup?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我有同样的问题。
通过使用 Proguard (4.6) 的最新版本而不是捆绑的版本解决了这个问题安卓 SDK (4.4)。
I had the same issue.
Resolved it by using the latest version of Proguard (4.6) instead of the version bundled with the android sdk (4.4).
这看起来像是 ProGuard 中的一个错误。您应该检查它是否在最新版本中尚未修复。否则,您可以在 Sourceforge 的 ProGuard 错误跟踪器上报告该错误。在这种情况下,问题可能很容易重现。您也许可以通过减少优化遍数来解决这个问题。
This looks like a bug in ProGuard. You should check if it hasn't been fixed in the latest release. Otherwise, you can report the bug on ProGuard's bug tracker at Sourceforge. In this case, the problem may be easy to reproduce. You can probably work around it by reducing the number of optimization passes.