在Proguard的类中找不到引用的方法 [英] can't find referenced method in class with Proguard

查看:242
本文介绍了在Proguard的类中找不到引用的方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用proguard执行混淆处理时,出现此错误:

when i execute obfuscation using proguard i get this error :

找不到引用的方法'javax.servlet.servletContext 类中的getServletContext() javax.servlet.http.httpServletRequest

can't find referenced method 'javax.servlet.servletContext getServletContext()' in class javax.servlet.http.httpServletRequest

我试图包括tomcat7中的servlet-api,但仍然是同样的问题. 有帮助吗?

i tried to include the servlet-api from tomcat7 , but still the same problem . any help ?

推荐答案

在错误消息中忽略您的小写/大写错字,这仅意味着ProGuard在类路径中以某种方式使用了Servlet 2.5或更早版本.在中引入 Servlet 3.0.因此,具体问题在于ProGuard的设置/配置.您需要从ProGuard的设置中删除所有Servlet 2.5或更低版本的库,并添加与Servlet 3.0兼容的库.

Ignoring your lowercase/uppercase typos in the error message, this can only mean that ProGuard is somehow using Servlet 2.5 or older in the classpath. This method was introduced in Servlet 3.0. So the concrete problem is in ProGuard setup/configuration. You'd need to remove any Servlet 2.5-or-older libraries from ProGuard's setup and add a Servlet 3.0 compatible one.

这篇关于在Proguard的类中找不到引用的方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆